Hi, I am a new user of Keil C compiler. During debug, I am trying to watch struct data members. But all of them show 0x0000. And they are not updated. With other variables it's just working fine. Any suggestions? Thanks, Titu
"don't use the word static when declaring the item in your c-file but instead declare it as external in the header file belonging to that c file." Let's get the terminology correct here: "don't use the word static when defining the item in your c-file but declare it as external in the header file belonging to that c file." In other words: The definition needs to be in exactly one .c file - without the 'static' keyword; The 'extern' declaration should be in the header file. Remember: The definition is what actually creates the item - this is what causes memory to be allocated; The declaration merely provides information for other modules that need to access the item - it causes no memory allocation.
Let's get the terminology correct here: "don't use the word static when defining the item in your c-file but declare it as external in the header file belonging to that c file." In other words: The definition needs to be in exactly one .c file - without the 'static' keyword; The 'extern' declaration should be in the header file. You've put it in an more correct context, Andy, which is absolutely OK. But you understood what I was trying to explain, and that's the most important for me! ;-) -- Geert