- Where Developers Learn, Share, & Build Careers
In a tutorial he said
If you use the Goto statement to jump mid The automatic variable of the block is not started. Then if I can be accessed / declared in the code below, why is not it started? ps: Output is some garbage value. there is no logic behind your question "if Reading an unexpired variable is an undefined behavior, so your program is bad. Memory is already kept separate on compiled time for the variable The rule of thumb: Do not jump in early start.
int main () {hereo here; {Int i = 10; Here: printf ("% d \ n", i); } Return 0; }
i Can be reached, why ... ". Despite being able to "access
i ", there is no argument for something or against it, this means that the
printf statement is the same as the
I . However, since you jumped on the starters, then the variable has not been started (like your tutorial says).
i , because the variable exists inside the internal block. Memory is not dynamically allocated, as you can imagine. It is already there, but it has never been fixed due to
goto .
Comments
Post a Comment