The function strcmp does not seem to like quotation marks in a string. I'm using GNU C++ 5.x. Did I miss something?
printf("%s\r\n", mystring ); // Output: "00"
if ( strcmp( mystring, "\"00\"" ) == 0 )
{
...
}
FYI...I wrote my own function that works just fine.
BOOL StrMatch(char *str, char *match)
{
while (*match)
{
if (!*str) return 0;
if (toupper(*str++)!=toupper(*match++)) return 0;
}
return 1; // no differences found
}
using cygwin's g++ v6.4 which is newer but this sort of code should work all the way back to version 1.0
as noted your code is not always correct and it is also less efficient. A modern strcmp can dump the string as blocks of 64, even 128 bits at a time to the registers for comparison, rather than 1 byte at a time, among other tweaks (it can treat them as blocks of integers).