I have the following code that initializes an array of unsigned chars:
unsigned char ultralightAtr[] = {0x3b,0x8f,0x80,0x01,0x80,0x4f,0x0c,0xa0,0x00,0x00,0x03,0x06,0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x68};
When i inspect ultralightAtr in gdb I don't get the same values:
(gdb) x/20x ultralightAtr
0x7fffffffdd40: 0x70 0xdd 0xff 0xff 0xff 0x7f 0x00 0x00
0x7fffffffdd48: 0x70 0x19 0xbd 0xf7 0xff 0x7f 0x00 0x00
0x7fffffffdd50: 0x00 0xc7 0xfd 0xf7
(gdb)
Am I doing something wrong initializing the array or is it something wrong with the way I am printing the memory content in gdb?
main()so that the c init code has run and has initialisedultralightAtr. Have you done that, or are you running that immediately after loading the program?