User forums > Using Code::Blocks
watch value 'inside' adress when debugging?
Stauricus:
hello everybody
is it possible, when debugging, to watch a value pointed by a pointer? i mean, to see what is inside that adress?
in this picture, pi shows 0x7fffffffe714. is it possible to see the value 10 trough pi?
i searched about it, and found some people saying to dereference the pointers. but do they mean dereferencing in the actual code? do i have to make it to all pointer variables that i want to see "inside"? :o
i hope i was able to explain the issue... :-\
thanks for the help!
oBFusCATed:
Add pi as a watch and right click dereference or just add *pi as a watch.
Stauricus:
thanks, it works! but and in this another situation, using arrays, is it also possible? it doesn't seems to work to me, since no "dereference" option shows up.
--- Code: ---int main(){
int i = 10;
int* n[1] = {&i};
return 0;
}
--- End code ---
oBFusCATed:
For arrays you have to right click on the watch -> properties -> mark it as array and specify a size.
Stauricus:
it did not work in the case... no "dereference" option yet.
but if i add **pi as a watch, it shows the value. i didn't knew i could add the variable names manually in the watch window before your answers :P
thank you!
EDIT: ok, no just one more problem. how to watch multidimensional arrays of pointers?
up to now, i'm like this:
but i'm not able to see the values, just adresses.
thanks again!
EDIT AGAIN:
omg, i feel stupid. i didn't knew i could add things like *p[1][1] and *0x5555555a46b0 to the watch screen. problems solved!
thank you very much!
Navigation
[0] Message Index
[#] Next page
Go to full version