Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Declaring variables

Name: Anonymous 2010-05-01 17:18

Should one declare variables (in C) at the begining of a function? I allways declared them before the first use, now i start to question if this is right.
What is the right thing to do /prog/?

Name: Anonymous 2010-05-01 23:20

>>1
As you can see, you are permitted to declare variables anywhere. However, this is not healthy; if you've got a bunch of new variables coming into play, you ought to have a new function.

Carefully organizing your variables will also help with memory management, which is crucial in C. I'm sure you know that part.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List