|
-
June 20th, 2012, 07:27 AM
#1
Scope, memory usage and goto
Code:
Start:
{
int i = 0;
i++;
goto Start;
}
My teacher told me never to use goto statements, trying to figure if there's another reason apart making the code less reable
Was wondering if this would cause an infinite memory usage because of redeclaring a variable each "loop" ? Or will the garbage collector empties the memory once we go out of scope ?
If the second is yes then what about that
Code:
{
Start:
int i = 0;
i++;
goto Start;
}
This one should use a lot of memory, no ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|