Quote Originally Posted by algorism View Post
You can't just throw in a library function call and expect it to work. You need to actually read about how the function works and use it correctly. For instance, if you read about strcmp you would learn that you need to include string.h to use it. Also, you would learn that it returns 0 if the strings are equal, so it's usually used like this:
Code:
if (strcmp(a, b) == 0)
    ; // strings are equal
else
    ; // strings are not equal
And you need to use fgets instead of the (no longer in the modern language) gets. But fgets leaves the newline in the string, so you'll either have to remove it or add a newline to your test string. A good way to remove it:
Code:
int len = strlen(s);   // strlen requires string.h
if (s[len - 1] == '\n')
    s[--len] = '\0';
BTW, your editor looks like it's from 30+ years ago. Are you a time traveller?

Then which IDE you suggest. Currently I am using Turbo C++ 3.0 Windows 7. And thanks for your help.