Lecture overview -- Keyboard shortcut: 'u'  Previous page: Declarations and definitions -- Keyboard shortcut: 'p'  Next page: Declaring several names together -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home    Basic facilities - slide 6 : 42

The structure of a declaration

A declaration of a single entity consists of a four parts:

A specifier (optional), a base type, a declarator, and an initializer (optional)

  unsigned int i = 7;
  const double d = 5.7;
  char* str[] = {"This", "is", "a", "string", "array"};
  extern short int ei;
  bool is_even(int a);
  Point p1(1,2);
  Pair q1 = {3,4};