- This topic has 0 replies, 1 voice, and was last updated 18 years, 10 months ago by .
Viewing 0 reply threads
Viewing 0 reply threads
- The forum ‘C Programming’ is closed to new topics and replies.
Home › Forums › C Programming › Best coding techniques
hello,
what do u think is the best coding technique we should adopt?
I have two exampes here. please comment on them.
1 2 3 4 5 6 | void myFunction{<br /> int myInt=0;<br /> if(myInt==0){<br /> printf("Zero");<br /> }<br /> } |
1 2 3 4 5 6 7 8 9 | void myFunction<br /> {<br /> int myInt;<br /> myInt=0;<br /> if(myInt==0)<br /> {<br /> printf("Zero");<br /> }<br /> } |
Few things to consider here.
1: initializing the variable and declaring at the same time.
2: adding the curly braces after the expression
3: indenting the code
4: adding the curly braces at the new line.
Please comment.
Thanks