You can assign an initial value to a variable when you declare it. For example:
int i=1;
sets the int variable to one as soon as it's created. This is just the same as:
int i;
i=l;
but the compiler may be able to speed up the operation if you initialise the variable as part of its declaration. Don't assume that an uninitialised variable has a sensible value stored in it. Some C compilers store 0 in newly created numeric variables but nothing in the C language compels them to do so.
Variable names:
- should be lowercase for local variables
- should be UPPERCASE for symbolic constants (to be discussed later)
- only the first 31 characters of a variables name are significant
- must begin with a letter or _ (under score) character