Hi,
I've a lot of troubles working with the memcmp command. I want to compare two strings, which are equal, but the programm tells me that they are not equal. Both memory locations have the same values.
unsigned char *pdata; const char *pName; //do some stuff - e.g. get their values memcmp((void *)pdata, (void *) pName, strlen((const char *)pName));
best regards Howard
How do you know that?
You say that both memory locations have the same values. But does the memory region pointed at by pName contain a terminating zero within the buffer, so you don't perform a memcmp() of two much larger memory regions than you think?
Per probably got it: does the problem disappear if you pad your buffers with 0x20s at program start....?
that's the point - thank you very much for your fast answers!