I dont understand why I'm getting this error here.
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
string value;
int number;
cout << "Enter an integer: ";
getline( cin, value );
if( !isvalidInt( value ) )
cout << "The number you entered is not a valid integer." << endl;
else
{
number = atoi( value.c_str() );
cout << "The number you entered is " << number << endl;
cout << "Its square root is " << sqrt( number ) << endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}
I'm getting this error:
`isvalidInt' undeclared (first use this function)
I can't declare it cause then I ca't use it as a function.
The purpose for the exercise is to modify the program to continually request an integer until a valid number is entered.
Where did that isvalidInt come from?