May be it is one of the simplest things for C programmers but I really can’t get it.
unsigned char Value[4];
unsigned long ulVer = 00010001;
unsigned long uSize = sizeof(ulVer);
memcpy(Value, &ulVer, uSize);
memcpy(&ulVer, Value, uSize);
printf("%d",ulVer);
Why ulVer is 4097, not 10001 ?
Because an integer constant that starts with 0 is considered to be octal (base 8). So a number 10001 (in octal) == 4097 in decimal.