c++ cZar

Showing posts with label variables. Show all posts
Showing posts with label variables. Show all posts

Tuesday, August 31, 2010

Use the variable closer to its use

Its good programming practice to define the variable closer to its use.
Eg. In cpp, this is better code:
for(int i = 0; i{...}

rather than
int i;
...
...
for(i=0;i
Posted by Rekha Kumari at 2:27 AM No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: cleaner code, variables
Older Posts Home
Subscribe to: Comments (Atom)

Blog Archive

  • ▼  2011 (2)
    • ▼  October (1)
      • Output of C program (printf)
    • ►  September (1)
  • ►  2010 (131)
    • ►  October (9)
    • ►  September (40)
    • ►  August (44)
    • ►  July (5)
    • ►  April (28)
    • ►  March (2)
    • ►  February (1)
    • ►  January (2)
  • ►  2009 (125)
    • ►  December (99)
    • ►  November (5)
    • ►  September (8)
    • ►  August (1)
    • ►  June (11)
    • ►  January (1)
  • ►  2008 (25)
    • ►  August (25)

About Me

Rekha Kumari
View my complete profile
Simple theme. Powered by Blogger.