Next: Defining Global Variables Up: Basic C Programming Previous: C Program Structure

Variables

C has the following simple data types:

The Pascal Equivalents are:

On UNIX systems all ints are long ints unless specified as short int explicitly.

NOTE: There is NO Boolean type in C - you should use char, int or (better) unsigned char.

Unsigned can be used with all char and int types.

To declare a variable in C, do:

var_type list variables;



Dave.Marshall@cm.cf.ac.uk
Wed Sep 14 10:06:31 BST 1994