六大部件

分配器:为容器分配内存
迭代器:算法只能通过迭代器访问容器
容器

Array
定长数组
_M_instance:指向数组首元素的指针(int a[10]的a)

endl
将与设备关联的缓冲区(buffer)中的内容刷到设备中。在调试时应保证”一直”刷新流。否则若程序崩溃,输出可能还是缓冲区,导致对于程序崩溃位置的错误推断
读取数量不定的输入数据可用while (std::in >> value)
当遇到文件结束符(end-of-file),或遇到一个无效输入时,istream对象状态变为无效,使条件为假
EOF:在Windows中为Ctrl+Z
,UNIX为Ctrl+D
预处理(Preprocessing)
将所有的#include头文件以及宏定义替换成其真正的内容,预处理之后得到的仍然是文本文件,但文件体积会大很多。gcc的预处理是预处理器cpp来完成的。(include只做文本插入,在include的位置将头文件展开)
编译(Compilation)
这里的编译不是指程序从源文件到二进制程序的全部过程,而是指将经过预处理之后的程序转换成特定汇编代码(assembly code)的过程。
一个cpp文件是一个编译单元。
汇编(Assemble)
汇编过程将上一步的汇编代码转换成机器码(machine code),这一步产生的文件叫做目标文件,是二进制格式。
这一步会为每一个源文件产生一个目标文件。
链接(Linking)
链接过程将多个目标文以及所需的库文件(.so等)链接成最终的可执行文件(executable file)
预处理阶段将宏所写内容替换
宏没有类型检查
在宏外加括号防止运算符优先级错误
在宏后不需要加分号(非C++语句)
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
1 | $ hexo new "My New Post" |
More info: Writing
1 | $ hexo server |
More info: Server
1 | $ hexo generate |