码迷,mamicode.com
首页 >  
搜索关键字:c++ primer第四版    ( 73个结果
派生类(多级)到基类转换的可访问性
《C++primer》第四版 15.3.1节提到基类到派生类转换(无论ref/poniter or not)的可行性,有些拗口,根据英文版翻译,得到以下几个要点:1.如果是public继承,则用户代码和后代类都可以使用派生类到基类的转换。2.如果类是使用private或protected继承派生的,...
分类:其他好文   时间:2015-11-15 17:47:38    阅读次数:181
C++ Primer第四版 15.9 再谈文本查询 程序实现
C++Primer第15章学习
分类:编程语言   时间:2015-09-11 20:43:24    阅读次数:230
类作用域中名字查找的思考(《C++ primer》第四版P382)
1、问题的引入 1).观察以下第一块代码: #include using namespace std; class Screen{ public: void test(){ dummy_fcn( ); } void dummy_fcn( ){ } }; 此代码编译无错误。。。。。。。。。。。...
分类:编程语言   时间:2015-06-11 21:18:22    阅读次数:163
【转载】 C++ stl string 操作
总结一下C++中string的操作,来自〈C++ Primer〉第四版。1. string对象的定义和初始化:12345678910111213string s1; //空串string s2(s1); //将s2初始化为s1的一个副本string s3("value...
分类:编程语言   时间:2015-05-22 16:47:05    阅读次数:171
C++ Primer (第四版)课后习题9.26 删除容器元素
习题9.26:假设有如下ia的定义,将ia复制到一个vector容器和一个list容器中。使用单个迭代器参数版本的erase函数将list容器的奇数值 元素删除掉,然后将vector容器中的偶数值删除掉。代码:#include #include #include #include using...
分类:编程语言   时间:2015-05-10 20:09:53    阅读次数:140
C++ Primer第四版习题--5.18
#include #include #include using namespace std; int main() { vector spvec; string str; while(cin>>str) { string *sp = new string; *sp = str; spvec.push_bac...
分类:编程语言   时间:2015-05-07 22:14:45    阅读次数:168
C++ Primer第四版习题--4.28
#include #include int main() { std::vector ivec; int temp; while(std::cin>>temp) ivec.push_back(temp); int *cp =new int[ivec.size()]; for(std::vector::iterator iter=ivec...
分类:编程语言   时间:2015-05-07 16:55:21    阅读次数:180
C++ Primer第四版习题--4.30
#include #include int main() { const char *cp1 = "Hello!"; const char *cp2 = "How are you."; size_t len = strlen(cp1) + strlen(cp2); char *result = new char[len]; strcpy(result,...
分类:编程语言   时间:2015-05-07 16:52:55    阅读次数:130
C++ Primer第四版习题--4.26
#include #include int main() { const int buf_size = 1024; char *str1, *str2; str1 = new char[buf_size]; str2 = new char[buf_size]; std::cin >> str1 >> str2; int result;...
分类:编程语言   时间:2015-05-07 14:34:00    阅读次数:148
C++ Primer第四版习题--3.18
#include #include //#include int main() { std::vector ivec(10, 0); int num; for(std::vector::iterator iter=ivec.begin(); iter!=ivec.end(); ++iter) { std::cin >> num...
分类:编程语言   时间:2015-05-06 18:03:35    阅读次数:146
73条   上一页 1 2 3 4 5 ... 8 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!