In C, do braces act as a stack frame?
Posted
by Claudiu
on Stack Overflow
See other posts from Stack Overflow
or by Claudiu
Published on 2010-05-03T16:02:25Z
Indexed on
2010/05/03
17:18 UTC
Read the original article
Hit count: 361
If I create a variable within a new set of curly braces, is that variable popped off the stack on the closing brace, or does it hang out until the end of the function? For example:
void foo() {
int c[100];
{
int d[200];
}
//code that takes a while
return;
}
Will d
be taking up memory during the code that takes a while
section?
© Stack Overflow or respective owner