Home > other >  Variable problem
Variable problem

Time:09-25

Met a doubt, I define a global variable for the character type, initialized to 0, its value will be difficult to express the assignment before quoted, and defined as short integer, but not so

CodePudding user response:

Memory is not initialized before some random values

CodePudding user response:

I think you watched this variable in the character form, because the character of "0" on the value is not zero!

CodePudding user response:

reference 1/f, worldy response:
memory is not initialized before some random numerical

Well, I variable is initialized

CodePudding user response:

refer to the second floor Glen_hsu response:
I think is you watched this variable in the character form, because the character of "0" on the numerical value is not zero!


I give you a figure and have a look, I change a value to the variable is initialized, unsigned char s_t_flag=2, key inspection passed, a new assignment 1, but I don't know why its value changed again, in this cycle is not related to operate other assignment

CodePudding user response:

S_t, add the following variables is the timer interrupt s_t_flag s_t + + has a value of 1 is,

CodePudding user response:

Get into the habit of memset fu 0 bai
  • Related