![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
烨然_
个人网站gaoye.xyz
展开
-
简单的class及运算符重载
#include <iostream> #include <vector> #include <algorithm> using namespace std; class Action { public: int room; int time; int type; Action(int room_, int time_, int type_) ...原创 2020-02-29 15:34:13 · 546 阅读 · 0 评论 -
从文本中读入数据
测试代码时经常需要重定向输入输出,下面是一个简单例子。 freopen ("input.txt", "r", stdin); int n; cin>>n; cout<<"n is "<<n<<endl;原创 2020-02-29 15:29:25 · 477 阅读 · 0 评论 -
vector 使用整理
借鉴网上资料,整理了vector使用的一些方法,记录下来,方便以后查阅 vector初始化 vector&lt;int&gt;a(10) //只定义长度 vector&lt;int&gt;a(10,1)//长度为10,初始值为1 vector&lt;int&gt;a(b); //用b向量来创建a向量,整体复制性赋值 vector&lt;int&gt;a(b.begin()原创 2018-07-29 17:15:35 · 295 阅读 · 2 评论 -
c++ 获取系统时间转换为字符串,整型转换为字符换
#include <iostream> #include <string> #include <sstream> #include <time.h> using namespace std; string get_time_str() //return a string of time { time_t ts = time(NULL); ...原创 2018-07-28 11:52:10 · 766 阅读 · 0 评论 -
C++常用函数整理
1. memset 函数解释: 函数原型: 常用形式:原创 2018-10-18 13:57:00 · 1560 阅读 · 0 评论