2-1注意: 1、c++只规定了各类型的内存最小尺寸,同时字节数至少 long long >=long>=int>=short; 2、字符型分为 char、signed char和unsigned char。类型char 实际会表现为上述哪种类型,具体由编译器决定;VS2013中,char == s ...
分类:
编程语言 时间:
2018-05-03 23:27:10
阅读次数:
229
第十三章 类继承 1、类继承:扩展和修改类。 2、公有继承格式:冒号指出B类的基类是A,B是派生类。 class B :public A { 。。。 }; 3、派生类对象包含基类对象。使用公有派生,基类的公有成员将成为派生类的公有成员;基类的私有部分也将成为派生类的一部分,但只能通过基类的公有和保护 ...
分类:
编程语言 时间:
2018-05-03 16:35:06
阅读次数:
158
"《C++ primer plus 英文版 第六版》" 娓娓道来。建议买这本,这个是上下分册。而且,出版时间是最新的2015年,买回来发现网上的勘误基本都被纠正过来了,极个别错误没有影响到理解,好哎!而且发现遣词造句特别简单,读着也顺畅。 电子版(PDF): "C++ Primer Plus Six ...
分类:
编程语言 时间:
2018-04-29 15:29:57
阅读次数:
188
Chapter Review 1 An entry condition loop evaluates a test expression before entering the body of the loop. If the condition is initially , the loop ne ...
分类:
编程语言 时间:
2018-04-29 15:29:11
阅读次数:
161
Chapter Review 1. Having more than one integer type lets you choose the type that is best suited to a particular need. For example, you could use to c ...
分类:
编程语言 时间:
2018-04-29 15:27:18
阅读次数:
192
Chapter Review 1 a. b. c. d. 2 a. b. c. d. 3 4 5 `cout size; int dyn = new int [size]; vector dv(size); 14 Yes, it is valid. The expression "Home of t ...
分类:
编程语言 时间:
2018-04-29 15:22:39
阅读次数:
208
Chapter Review 1 Both version give the same answers, but the version is more efficient. Consider what happens, for example, when is a space. Version 1 ...
分类:
编程语言 时间:
2018-04-29 15:20:25
阅读次数:
156
1. #include <iostream> const int CONVER_FACTOR = 12; int main(int argc, char* argv[]){ int height = 0; std::cout << "Pleas enter your height with inch ...
分类:
编程语言 时间:
2018-04-27 02:16:32
阅读次数:
176
前言:之前说看《C++ Primer 》暂时搁浅一下,迷上公司大神写的代码,想要明白,主要是socket、进程间通信! 知道进程间通信:信号、信号量、管道、消息队列、共享内存(共享存储),也能写些简单代码进行通信,但不知道应用在哪?感觉很多小伙伴跟我有类似经历吧? 一、应用实例: 要去linux设备 ...
分类:
系统相关 时间:
2018-04-25 20:58:25
阅读次数:
183
unique_ptr ? 一个unique_ptr拥有它所管理的对象,与shared_ptr不同,unique_ptr指向的对象只能有一个用户。当unique_ptr被销毁后,它所指向的对象也被销毁。 ? 与shared_ptr不同,没有类似make_shared_ptr的标准函数返回一个unqiu ...
分类:
编程语言 时间:
2018-04-25 20:56:52
阅读次数:
174