next up previous
Next: Control Structures Up: C Primer CS 1005 Previous: C Primer CS 1005

Data Types


int    i = 4;   // (32-bit) signed integer
double d = 2.0; // (64-bit) real number
char   c = 'x'; // '\n' is a character, too
char   c[30] = "This could be a string"; // character array = string
int    a[10];   // an array of 10 integers (indices from 0 to 9)
struct Person {
   char lastName[30];
   char firstName[20];
   int  yearOfBirth;
};               // a structure, containing several primitive data types


Andreas Koeller
2000-06-04