Lecture overview -- Keyboard shortcut: 'u'  Previous page: The Popularity of C and C++ -- Keyboard shortcut: 'p'  Next page: Fundamental types -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Lecture 1 - Page 12 : 29
Notes about C++
From C to C++
The C preprocessor

For definition of symbolic constants and file inclusion

  • #include

    • #include <stdio.h>

    • #include "myfile.h"

    • Typically used for inclusion of header files

  • #define

    • #define PI 3.14159

    • #define product(x,y) ((x)*(y))

    • Definition of symbolic constants and function-like abstractions

  • #if ... #else ... #endif

    • #ifdef ...

    • ifndef ...

    • For conditional compilation