CodePudding user response:
In general, effective, in the area of the definitions of the so-called scopes, and variables defined within a loop, equivalent to the inside of the block, applies only to the current blockCodePudding user response:
Definition in the outside, he is just the first cycle when the initial value of x is zeroInternal definition, that is, each cycle, its initial value is zero
CodePudding user response:
VS have a more wonderful work, however, is that in the for variables defined inside, outside is still valid, so, if two for define the variables with the same name is not allowed inside, generally the best move to the front to defineCodePudding user response:
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html