【文件属性】:
文件名称:超清晰PDF C++
文件大小:8.38MB
文件格式:PDF
更新时间:2012-08-16 22:43:17
C++ Basics
1.1 INTRODUCTION TO C++ 2
Origins of the C++ Language 2
C++ and Object-Oriented Programming 3
The Character of C++ 3
C++ Terminology 4
A Sample C++ Program 4
1.2 VARIABLES, EXPRESSIONS, AND ASSIGNMENT
STATEMENTS 6
Identifiers 6
Variables 8
Assignment Statements 10
Pitfall: Uninitialized Variables 12
Tip: Use Meaningful Names 13
More Assignment Statements 13
Assignment Compatibility 14
Literals 15
Escape Sequences 17
Naming Constants 17
Arithmetic Operators and Expressions 19
Integer and Floating-Point Division 21
Pitfall: Division with Whole Numbers 22
Type Casting 23
Increment and Decrement Operators 25
Pitfall: Order of Evaluation 27
1.3 CONSOLE INPUT/OUTPUT 28
Output Using
cout 28
New Lines in Output 29
Tip: End Each Program with
\n or
endl 30
Formatting for Numbers with a Decimal Point 30
Output with
cerr 32
Input Using
cin 32
Tip: Line Breaks in I/O 34
1.4 PROGRAM STYLE 35
Comments 35
1.5 LIBRARIES AND NAMESPACES 36
Libraries and
include Directives 36
Namespaces 37
Pitfall: Problems with Library Names 38
CHAPTER SUMMARY 38
ANSWERS TO SELF-TEST EXERCISES 39
PROGRAMMING PROJECTS 41