Initialise all variables

This tip submitted by Jia.Lu on 2005-10-05 06:26:18. It has been viewed 55161 times.
Rating of 5.6 with 266 votes



Remember to init them at declaration:

int counter = 0 ;
char strings[MAX] = '\0' ;
memset(&structX,0,sizeof(structX)) ;
char *cp = NULL ;



More tips

Help your fellow programmers! Add a tip!