Ask your own question, for FREE!
Computer Science 17 Online
OpenStudy (anonymous):

http://ideone.com/kzM7N http://ideone.com/2UahK Is that the right way to emulate C++'s "declaration of a variable within the for loop" feature in C?

OpenStudy (llib_xoc):

They both look fine to me. Declaring the loop variable inside a block, formed by the curly braces makes it invisible outside that block, which matches the semantics of the C++ loop variable. Why have you declared the loop variable 'volatile'?

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!