Question
Cosmic compiler and strcmp
Posted on March 23, 2013 at 18:04
I'm trying to compare an input string, and using the COSMIC C environment. I've had no luck with their supplied strcmp function, so I gave up and wrote my own...
But still wondering what is wrong... Here is the test case, when I run it, the result of strcmp is always zero: Anyone has an idea?u8 result;
result = strcmp(''A\0'', ''A\0'');
if (result != 0){
SerialPutString(''A=A Not zero\n'');
} else {
SerialPutString(''A=A Zero\n'');
}
result = strcmp(''A\0'', ''B\0'');
if (result != 0){
SerialPutString(''A=B Not zero\n'');
} else {
SerialPutString(''A=B Zero\n'');
}
while(1){
}