![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
小白的C++学习
文章平均质量分 52
csdn_small_white
这个作者很懒,什么都没留下…
展开
-
关于STL容器set与multiset的区别
现象: 两者都是STL中的一种容器,在插入数据时可以起到自动排序的功能 如图,若插入上述五个数据则会输出排完序的五个数,结果为: 可以发现少了一个数据10,这是因为在第二次插入10的时候,set容器检测到已经有了一个10,从而插入失败,set与multiset的区别也就在于set不能插入相同的数据,而multiset可以,验证如下: 原因探究: 查看set容器的insert函数的定义 发现insert是一个返回值为pair容器,数据类型包含迭代器和bool,其中boo...原创 2021-10-23 20:35:08 · 91 阅读 · 0 评论 -
如何将类拆分至头文件
Circle.h #pragma once #include<iostream> using namespace std; #include"Point.h" class Circle { private: int m_R = 0; Point Center; public: void setR(int r); int getR(); void setCenter(int x, int y); void judgement(Point&...原创 2021-10-04 15:14:01 · 170 阅读 · 0 评论 -
【黑马程序员】通讯录管理系统----个人改良版(附带程序打包)
#include<iostream> using namespace std; #define Max 1000 void showMenu() { cout << "*************************" << endl; cout << "***** 1、添加联系人 *****" << endl; cout << "***** 2、显示联系人 *****" << endl; ...原创 2021-09-27 16:30:55 · 866 阅读 · 2 评论 -
小tips
ctrl+k+c 批量注释 ctrl+k+u 批量取消注释 vs2019中,头文件后不加;原创 2021-09-21 13:14:08 · 68 阅读 · 0 评论