好吧,第一次写东西...如何下手呢...(请无视)
--------------------------------------------------------------
Chapter 1. Getting Started
1.1 Write a Simple C++ Program
函数组成:返回类型(type)、函数名、参数列表、函数体
*函数体中的return返回类型要与函数的返回类型相匹配。
*类型Type:包含了数据元素的内容和对其可能的操作。
源文件(Source files):一般指程序文件,常见扩展名:.cc, .cxx, .cpp, .cp, .C
1.2 A First Look at Input/Output
IO函数由标准库(standard library)提供,使用前开头加上相关头文件,如<iostream.h>
标准输入:cin
标准输出:cout
*cerr用以输出警告和错误消息;clog用以输出程序执行的信息。
**表达式:会得到一个结果并与多个操作域和一个操作符相联系(an expression yields a result and is composed of one or more operands and (usually) an operator.)
*endl(a manipulator)用以结束当前行并对缓存器进行刷新。
std::cin std::cout 前缀std称为命名空间(namespace),可以保证不必要的名字冲突。
::操作符,表明cin函数和cout函数是用std命名空间里的。
Exercise Section 1.2
1 void Exericse_1_3() 2 { 3 std::cout << "Hello, World" << std::endl; 4 }