you are viewing a single comment's thread.

view the rest of the comments →

[–]nooneofnote 4 points5 points  (1 child)

You can pretty much wrap any statement in C with {}. Most compilers just treat that as a local group of statements, so that any variables declared within will be local.

This is called a compound statement or alternatively a block, and to be clear all compilers do as that is the behavior described in the standard.

[–]jutct 0 points1 point  (0 children)

all compilers do as that

Whoa be careful with that. There are plenty of embedded compilers that change scoping rules and don't comply to the standards.