Hi,
I am trying to compare two strings. When i enter two arguments on the command line 12 and 100, the flag1 should be set to 1 because
(argv[1] =) "100" > (junk2 = )"13". But this is not happening. So, how can i check that the input arguments entered on the command line are less then 13 and are only numbers.
I tried using atoi but did not work because argv[is] is not string. I need junk2 to be string becuase i am reading the value of junk2 from a file.
Please help.
string junk2 = "13";
int flag1 = 0;
for(int is=1; is<argc; is++)
{
if(argv[is] > (junk2)
{
cout << "The input " << argv[is] << " is incorrect" << "\n";
flag1 = 1;
}
}
Thanks