Hey, I am getting a compiler error that I don't agree with (haha). I am attempting to compare chars, but the error the compiler is giving me is:
Code:
46 prog6.cpp ISO C++ forbids comparison between pointer and integer
My code is:
Code:
int main(int argc, char *argv[])
{
[snip]
if(argv[typeIndex] != 's')
{
cerr << "Invalid Type argument '" << argv[typeIndex] << "'.\n";
exit(1);
}
}
If I changed the single quotes around the s to double quotes "s" it compilers, however even if argv[typeIndex] is equal to "s" the error message still appears.
Code:
Invalid Type argument "s".
Any ideas?