C++ Program Design
An Introduction to Programming
and Object-Oriented Design
A Rich History
!
"
##
$%
&'(
)*+,--
.(,-+
/**
" *&-
'+!/,
*,(0*+
-#0*+
12-30*
+
1'(
&(
(/.&"
"(2"/&
*,
('+
4-,*
Chap. 2 C++: The fundamentals
•
function main()
•
include
•
comments
•
definitions
•
simple interactive
input and output
•
integer, floating-
point, and character
types
•
integer, floating-
point, and character
literals
Key Concepts
•
C++ names
•
declarations
•
expressions
•
usual unary conversions
•
usual binary conversions
•
operator precedence
•
operator associativity
•
iostream insertion and ex
traction
A FIRST PROGRAM
// Program 2.1: Display greetings
// Author: Bryan Zeng
// Date: 7/24/2002
#include <iostream>
using namespace std;
int main() {
cout << "Hello world!" << endl;
return 0;
}
"(&+,preprocessor
*
*