Hello,
I normally program embedded devices in ASM and my boss asked me to fix some code that was written in C, I have done a little C but not to much.
The problem I've noticed is that a comparison doesn't always return true.
We have an array of characters UBconfigData.code2[16] and we have a constant
Code:
#define VERSION "2.10"
#define ScaleType "47 "
#define ScaleVer ScaleType VERSION
when these two get compared sometimes true is return and sometimes it is not.
Code:
strcmp(UBconfigData.code2, ScaleVer )
UBconfigData.code2 is set by this method
Code:
strcpy(configData.code2,ScaleVer); //Update code1,2 to current version
I'm wondering does strcmp stop at the termination or does it continue to the end of the array?
Should I do a memcmp and memcpy?
Ron