![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++
文章平均质量分 78
猫叔的大师兄
这个作者很懒,什么都没留下…
展开
-
c++ primer 学习笔记-第一章
1.习题1-10:#include int main(){ std::cout << "this program will display numbers from 10 to 0 inclusive:" << std::endl; int num = 10; while (num >= 0) { std::cout << num << " ";//githu原创 2015-07-25 18:11:10 · 301 阅读 · 0 评论 -
c++ primer 学习笔记-第十四章
习题14.2:Sales_data.h:#ifndef SALES_DATA_H#define SALES_DATA_H#include #include #include using std::string;using std::cin; using std::cout; using std::endl;using std::istream; using std::o原创 2015-09-15 12:15:31 · 400 阅读 · 0 评论 -
c++ primer 学习笔记-第十三章
习题13.5:#ifndef TEST_H#define TEST_H#include #include class HasPtr{public: HasPtr(const std::string &s = std::string()) :ps(new std::string(s)), i(0){ }; HasPtr(const HasPtr &cs) :ps(new std:原创 2015-09-06 18:44:18 · 477 阅读 · 0 评论 -
c++ primer 学习笔记-第十二章
习题原创 2015-08-22 09:09:49 · 332 阅读 · 0 评论 -
c++ primer 学习笔记-第十章
习题10.1:#include #include #include #include using std::cin; using std::cout; using std::endl; using std::flush;using std::vector; using std::string;using std::count;int main(){ vector ivec;原创 2015-08-16 10:13:10 · 390 阅读 · 0 评论 -
c++ primer 学习笔记-第六章
习题6.2:#include #include #include #include using std::cin; using std::cout;using std::endl;using std::string; using std::vector;using std::begin; using std::end;原创 2015-08-03 21:33:30 · 417 阅读 · 0 评论 -
c++ primer 学习笔记-第五章
习题5.5:#include #include #include #include #include using std::cin; using std::cout;using std::endl;using std::string; using std::vector;using std::begin; using std::end;原创 2015-08-02 14:04:22 · 298 阅读 · 0 评论 -
c++ primer 学习笔记-第九章
习题9.4:#include #include using std::cin; using std::cout; using std::endl;using std::vector;using Iter = vector::const_iterator;bool find(Iter beg, Iter end, int num){ while (beg != end) {原创 2015-08-11 08:58:42 · 453 阅读 · 0 评论 -
c++ primer 学习笔记-第四章
习题4.21:#include #include #include #include #include using std::cin; using std::cout;using std::endl;using std::string; using std::vector;using std::begin; using std::end;using std原创 2015-08-02 12:16:56 · 340 阅读 · 0 评论 -
c++ primer 学习笔记-第三章
习题3-4:#include #include using std::cin; using std::cout;using std::endl; using std::string;int main(){ string s1, s2; while (cin >> s1 >> s2) { if (s1 == s2) cout << "same length" << e原创 2015-07-29 15:36:28 · 296 阅读 · 0 评论 -
c++ primer 学习笔记-第八章
习题8.1:#include #include using std::cin; using std::cout; using std::endl;using std::istream;using std::string;istream &f(istream &is){ string s; is >> s; for (; !is.eof(); is >> s) cout原创 2015-08-10 09:28:48 · 300 阅读 · 0 评论 -
c++ primer 学习笔记-第七章
习题7.1:#include #include using std::cin; using std::cout;using std::endl; using std::string;struct Sales_data{ string bookIsbn; unsigned units_sold = 0; double price = 0.0; double reve原创 2015-08-06 14:45:22 · 456 阅读 · 0 评论 -
c++ primer 复习-函数
学到动态内存的时候,出现许多使用函数尤其是类的相关知识的应用,因练习量不足,知识出现遗忘,继续学习颇感吃力。因此决定在向下学习之前,先开始第一轮复习,将重要的知识系统梳理一遍,以便完成后续的学习内容。1.参数传递①参数传递的方法有2种:传值参数、传引用参数。a.传值参数: 对于整形此类,就是形参拷贝实参,对形参的改变不影响实参;对于指针形参,拷贝的是指针本身,原创 2015-08-22 14:25:47 · 479 阅读 · 0 评论 -
c++ primer 学习笔记-第十一章
习题11.3-4:#include #include #include #include #include #include using std::cin; using std::cout; using std::endl;using std::string;using std::istream; using std::ifstream;using std::map; usi原创 2015-08-20 10:27:02 · 371 阅读 · 0 评论 -
c++ primer 学习笔记-第二章
啊啊啊原创 2015-07-26 09:36:54 · 323 阅读 · 0 评论 -
c++ primer 学习笔记-第十五章
习题15.3:#ifndef QUOTE_H#define QUOTE_H#include #include class Quote{public: //构造函数 Quote() = default; Quote(const std::string &book, const double &p) :bookNo(book), price(p){ } //返回ISBN编号原创 2015-09-17 19:31:33 · 394 阅读 · 0 评论