User forums > Help
Value in watches not show up for array of char and char* variable
kentut:
Here the screenshot after I set b[0] to 0x30 and b[1] to 0x31. The value still strange....
scarphin:
Actually there is nothing strange with the values. 0x30 is '0' and 0x31 is '1' and the first 2 characters of 'b' array correctly shows these values. The rest are some uninitialized random values which may not correspond to printable characters in ASCII table even when initialized to some value. So there doesn't seem to be anything wrong with the CB part.
oBFusCATed:
char [] is the same as const char *, so gdb thinks it is a string and tries to print it as string. For function args and locals nothing could be done.
But if you want to inspect the variable as character array, then add it as a watch and right click -> properties -> treat as array (set start and count) and you're good to go.
Navigation
[0] Message Index
[*] Previous page
Go to full version