C++ Help

Caporegime
Joined
18 Oct 2002
Posts
32,623
Another hint, you should really try to keep variables as local and within as smaller scope as possible. Code will be easier to read,easier to maintain and the compiler will have a much easier time optimizing.

Too many people code C++ as if it is code compiled in the 1980s.

It is perfectly fine to declare the. Loop counter within the for-statement,your compiler will thank you. Likewise, declare variables within loops if the context is only within the loops-scope- again, the compiler will prefer this to a higher scoped variable and will apply better optimization.
 
Back
Top Bottom