Declarations

All variables must be declared before they can be used

 

A declaration specifies a data type and a list of one, or more identifiers (names) to call the variable(s)

 

int myVar ;

 

or:

int myVar, cat, dog, potato ;

 

Multiple identifiers are separated by a comma. The above declares four variables of the data type int called myVar, cat, dog, potato.

Leave a Reply