Possible Duplicate:
C String — Using Equality Operator == for comparing two strings for equality
Basic question here. I'm compiling this program in g++ and running it with a single -r argument, (./a.out -r) however it does not output the specified cout statement below. Is there anything wrong with this code?
#include <string>
using namespace std;
int main(int argc, char* argv[]) {
if (argv[1] == "-r" ) {
cout << "First arg is -r" << endl;
}
return 0;
}