C++ Primer 4th Notes - Chapter 1 Getting Started
2009-02-04 10:44
731 查看
1.1. Writing a Simple C++ Program
Exercise 1.2, 貌似用echo %ERRORLEVEL%只能看到在command line运行的程序的返回值。
1.2. A First Look at Input/Output
C++ does not directly define any statements
to do input or output (IO). Instead, IO is provided by the standard library.
A stream is a sequence of characters
intended to be read from or written to an IO device of some kind.
cin(object of type istream), cout, cerr,
clog(objects of type istream).
Most operating systems give us a way of
redirecting the input or output streams when we run a program. Using
redirection we can associate these streams with files of our choosing.
endl is a special value, called a
manipulator, that when written to an output stream has the effect of writing a
newline to the output and flushing the buffer associated with that device.
1.3. A Word About Comments
1.4. Control Structures
1.4.4. Reading an Unknown Number of Inputs
while (std::cin >> value)
The input operator (Section
1.2.2, p. 8)
returns its left operand. When we use an istream as a condition,
the effect is to test the state of the stream.
Operating systems use different values for
end-of-file. On Windows systems we enter an end-of-file by typing a control-z simultaneously
type the "ctrl" key and a "z." On UNIX systems, including
Mac OS-X machines, it is usually control-d.
1.5. Introducing Classes
Headers for the standard library are
enclosed in angle brackets (<
>). Nonstandard headers are enclosed in double
quotes (" ").
Exercise 1.24, 习题解答给出的答案是加了限制的,要求了相同的ISBN挨着输,否则难度在于不知道需要多少个Sales_item对象。能不能用vector来解决?
1.6. The C++ Program
Exercise 1.26, 也不知习题解答给出的答案对不。
Exercise 1.2, 貌似用echo %ERRORLEVEL%只能看到在command line运行的程序的返回值。
1.2. A First Look at Input/Output
C++ does not directly define any statements
to do input or output (IO). Instead, IO is provided by the standard library.
A stream is a sequence of characters
intended to be read from or written to an IO device of some kind.
cin(object of type istream), cout, cerr,
clog(objects of type istream).
Most operating systems give us a way of
redirecting the input or output streams when we run a program. Using
redirection we can associate these streams with files of our choosing.
endl is a special value, called a
manipulator, that when written to an output stream has the effect of writing a
newline to the output and flushing the buffer associated with that device.
1.3. A Word About Comments
1.4. Control Structures
1.4.4. Reading an Unknown Number of Inputs
while (std::cin >> value)
The input operator (Section
1.2.2, p. 8)
returns its left operand. When we use an istream as a condition,
the effect is to test the state of the stream.
Operating systems use different values for
end-of-file. On Windows systems we enter an end-of-file by typing a control-z simultaneously
type the "ctrl" key and a "z." On UNIX systems, including
Mac OS-X machines, it is usually control-d.
1.5. Introducing Classes
Headers for the standard library are
enclosed in angle brackets (<
>). Nonstandard headers are enclosed in double
quotes (" ").
Exercise 1.24, 习题解答给出的答案是加了限制的,要求了相同的ISBN挨着输,否则难度在于不知道需要多少个Sales_item对象。能不能用vector来解决?
1.6. The C++ Program
Exercise 1.26, 也不知习题解答给出的答案对不。
相关文章推荐
- C++ Primer 4th Notes - Chapter 3 Library Types
- 《C++ Primer 4th Edition》读书笔记 - Chapter1 Getting Started
- C++ Primer 4th Notes - Chapter 2 Variables and Basic Types
- C++ Primer(4th) Chapter13 复制控制
- 《C++ Primer》 Defined Terms Chapter 1. Getting Started
- Beginning Linux Programming 4th Edition 学习笔记 - Chapter 1:Getting started
- C++ Primer 读书笔记 Chapter 8 标准I/O库
- APUE Reading Notes------Chapter 3
- 读书笔记:C++ primer 5th edition--chapter 3.字符串,向量,数组
- 41、C++ Primer 4th笔记,IO库,格式化IO操作
- C++ Primer 4th:第九章 《顺序容器》学习心得
- Chapter 0: Getting started
- Notes on LaTex: lshshort chapter 2 文本格式设置
- 《C++ Primer 4th Edition》读书笔记 - Part II: Containers and Algorithms
- C++ Primer 学习笔记 Chapter 9
- Veriog_Notes_Chapter 3
- C++ Primer 5e chapter 6
- Introduction to Algorithm - Summary of Chapter 2(0) - Getting started
- Head First Python Notes Chapter II 第二章
- Chapter 7、面向对象(二)---类 (4th,Mar.)