So I want to check to see if the command line argument I received was an integer. How do I do this?
However, the error message says that there is a request for member isdigit in *(argv + 4u) which is of nonclass type char*.Code:#include <iostream> using namespace std; int main(int argc, char* argv[]) { //************************** //Checking for correct input //************************** if ( argc != 2 ) { cerr << "Usage: " << argv[0] << " n" << endl; return 1; } if ( argv[1].isdigit() != 1 && ) { cerr << "Usage: n must be a positive integer." << endl; return 1; } }
I don't really understand the error message.