answersLogoWhite

0

Formally, in C, variable declarations occur first in the block, followed by process statements.

In C++, this was relaxed and declarations are permitted within the process statements. This allows somewhat easier code readability, since the declaration is near the use, but the style is yours to choose.

Most modern C compilers are also C++ compilers, so the C++ rules often work in C code, though you can set flags to enforce a certain standard, if you wish.

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

MaxineMaxine
I respect you enough to keep it real.
Chat with Maxine
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi

Add your answer:

Earn +20 pts
Q: How do you position your variable declarations and process statements?
Write your answer...
Submit
Still have questions?
magnify glass
imp