View Single Post
  #3   (View Single Post)  
Old 26th March 2011
thirdm thirdm is offline
Spam Deminer
 
Join Date: May 2009
Posts: 248
Default

They can be declared at the start of a block too, though whether that style is acceptable depends on who you're coding with. I like it as a C++ programmer -- the principle being that the smaller the visibility of the variable the simpler the analysis of program when reading it over for errors -- but it doesn't seem like a principle many C programmers agree with. For instance, the OpenBSD style man page has this to say:

" Parts of a for loop may be left empty. Don't put declarations inside blocks unless the routine is unusually complicated."
Reply With Quote