loop is simple to do
std::string maxlen;
int n = 0;
do
{
cin >> maxlen;
n = atoi(maxlen.c_str());
if(n <= 0)
cout << "You've entered a wrong number, please try again." << endl;
} while( n <= 0);
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343