C++ primer

1.what is relevant ,though, was the focus on composing a software out of well-delimited modules and that the main experimental tool was a relatively large and detailed simulator I wrote for simulating software running on a distributed system.

2.the initial version of this simulator was written in Simula and ran on the Cambridge University computer center's IBM 360/165 mainframe.

3.the contrast I perceived between the rigidity of Pascal and the flexibility of Simula was essential for the development of C++. Simula's class concept was seen as the key difference , and ever since I have seen classes as the proper primary focus of program design.

4.the class and co-routine mechanisms and the comprehensive type checking ensured that problems and errors did not grow more than  linearly with the size of the program. Instead,the total acted more like a collection of very small programs than a single large program and was therefore easier to write, comprehend, and debug.

5.the implementation of Simula did not scale in the same way. the cost arose from several language features and their interactions: run-time type checking, guaranteed initialization of variables,concurrency support, and garbage collection of both user-allocated objects and procedure activation records.

6.our belief is that there is no single correct style but that there is value in consistency.

7.when we exit the for loop, the variable val is no longer accessible,
it is not possible to use val after this loop terminates.However not all compilers enforce this requirement.

8.In pre-Standard C++ defined in a for header were accessible outside the for itself.

9.when we use an istream as a condition, the effect is to test the state of the stream. If the stream is valid that is, if it is still possible to read another input then the test succeeds, An istream becomes invalid when we hit end-of-file or encounter an invalid input,such as reading a value that is not an integer. An istream becomes invalid state will cause the condition to fail.

10.end-of-file
on UNIX system:control-d
on Windows systems:control-z

11.to use a class we need to know three things:
    what is its name?
    where is it defined?
    what operations does it support?

12.cerr: ostream object tied to the standard error.which is often the same stream as the standard output. by default,writes to cerr are not buffered.

13.clog: ostream object tied to the standard error. by default writes to clog are buffered. usually used to report information about program execution to a log file.

14.edit-compile-debug:the process of getting a program to execute properly.

15.library type: a type such as istream, defined by the standard library.

16.

猜你喜欢

转载自wwwjjq.iteye.com/blog/1685748