Welcome to Questionaries, where you can ask questions and receive answers from other members of the community.

Let us know at info@questionaries.org

In C, do braces act as a stack frame?

11 like 0 dislike
Hi guys,

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?
asked 1 year ago by biswaskeran (70,430 points)

Your answer

Email me at this address if my answer is selected or commented on:
Privacy: Your email address will only be used for sending these notifications.

0 Answers

Related questions

4 like 0 dislike
1 answer
asked 1 year ago by daneim (127,080 points)
4 like 0 dislike
0 answers
10 like 0 dislike
1 answer
13 like 0 dislike
1 answer
8 like 0 dislike
1 answer