User forums > Help

Debugger doesnt show me global variables

(1/1)

global:
hi,
I have codeblocks on windows 10/64bit and compile c-code with "gnu gcc compiler".

When I debug my programs and I want to know how the values of the variables change, watches only show me the local variables, but no global variables.

For example in this program:

--- Code: ---#include <stdio.h>

int a=3;

int main()
{
    printf("test");
    return 0;
}
--- End code ---

When I debug it, select the line "int a=3", make rightclick on it and click on "Watch int a=3;" I get this message in the watches window:
A syntax error in expression, near `a=3;'.

This happens with every global variable.

And also when I have in a function/procedure an array as an argument, it doesnt show me the values of the array, it seems to just show me the memory adress.

Can someone help?
thanks.

oBFusCATed:
Just add 'a' as watch, not the whole expression.

Navigation

[0] Message Index

Go to full version