Hello there, I'm having a problem with the strcmp return value. My compiler returns the correct value based on my research, but I tried to compile the code below on those online compilers and the result was 1.
My compiler gave me 10, which I consider to be the correct result according to strcmp - C++ Reference.
Can somebody explain this difference?
So strcmp is not very portable?
Here's the websites I used to test it:
C code - 8 lines - codepad
Compile and Execute Programs Online| Online IDE
Thanks in advance.
Code:#include <stdio.h> #include <string.h> int main(void) { printf("Return value: %d\n", strcmp("Rocks", "Rockie")); return 0; }