![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
《Accelerated C++》学习笔记
文章平均质量分 56
Choes
目前做公司的网控器项目,涉及的技术主要为网络编程
展开
-
Chapter 1: Working with strings
0. §1.1/9// ask for a person's name, and greet the person#include #include int main(){ // ask for the person's name std::c原创 2011-10-07 19:49:32 · 543 阅读 · 0 评论 -
Chapter 0: Getting started
§0.5std::endl表明endl是命名空间(namespace)std的一部分,命名空间是一个相关名称的集合。标准库使用std来包含所有由它定义的名称,若想在函数中不使用含作用域运算符(scope operator)”::”的限定名称(qualified name),则需使用#include指令(#include directive)包含相应头文件,并使用using声明所需使用的原创 2011-10-06 13:28:42 · 584 阅读 · 0 评论 -
Chapter 02 Looping and counting
1. 循环不变式(loop invariant)含义即为有一个变量在循环执行前、中、后的意义是恒定的,在循环体中可能会使变量不符合不变式,应在随后的语句进行矫正。// 不变式: 目前已写了r行int r = 0;// 将r初始化为0使不变式为真while (r != rows) { // 这里可以认为不变式为真 // 写一行后不变式为假 std::co原创 2012-07-09 12:51:48 · 477 阅读 · 0 评论 -
Chapter 03 Working with batches of data
1. cin作为判断条件的含义cin的类型是istream,istream是标准库的一部分,if(cin)或while(cin)的含义与istream的定义有关。类istream提供了一个转换来把cin转换成一个可以在条件中使用的值,这个转换所产生的值取决于istream对象的内部状态,这个状态会记住最近一次读数据的尝试是否成功。用cin作为条件等价于检测最近一次从cin读数据的尝试是否成功原创 2012-07-11 12:55:50 · 458 阅读 · 0 评论