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:
My code is:Code:46 prog6.cpp ISO C++ forbids comparison between pointer and integer
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:int main(int argc, char *argv[]) { [snip] if(argv[typeIndex] != 's') { cerr << "Invalid Type argument '" << argv[typeIndex] << "'.\n"; exit(1); } }
Any ideas?Code:Invalid Type argument "s".



LinkBack URL
About LinkBacks



CornedBee