Lecture1 Basic Programming Elements
Lecture1 Basic Programming Elements
Figure 2-3 Memory spaces after the statement length = 6.0; executes
x = 5; x = 5;
y = ++x; y = x++;
C++ Programming: From Problem Analysis to Program Design, Seventh Edition 49
Output
• The syntax of cout and << is:
• For example:
#include <iostream>
– Causes the preprocessor to include the header file
iostream in the program
• Preprocessor commands are processed before the
program goes through the compiler
y = w + x; //Line 4: error