bloggins02
Programmer
This might be really basic, but why does this not work:<br><br>int main (int argc, char **argv) <br>{<br> if (argv[1] != "server"<br> printf("Not a valid argument!\n"<br> return 0;<br>}<br><br>It never evaluates that argv[1] is equal to "server" even when I run it with "fooprog server". <br><br>This however does work:<br><br>int main (int argc, char **argv)<br>{<br> if ((strcmp(argv[1], "server" != 0)<br> printf("Not a valid argument!\n"<br> return 0;<br>}<br><br>What's so special about strcmp()? What am I missing here?<br><br>Thanks guys