随笔分类 -  C++

摘要:/********** huangsy13@gmail.com FileStruct.h **********/ #ifndef FILESTRUE #define FILESTRUE #include<unistd.h> #include<stdio.h> #include<string.h> # 阅读全文
posted @ 2016-11-09 17:17 Shiyu_Huang 阅读(368) 评论(0) 推荐(0) 编辑
摘要:main.cpp: #include <iostream>#include <vector>#include <cstring>#include <cstdio>#include <algorithm>#include <cmath> using namespace std; std::vector 阅读全文
posted @ 2016-09-16 18:34 Shiyu_Huang 阅读(449) 评论(0) 推荐(0) 编辑
摘要:1.安装g++ 下载https://sourceforge.net/projects/mingw/files/Installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin 阅读全文
posted @ 2016-09-16 13:55 Shiyu_Huang 阅读(223) 评论(0) 推荐(0) 编辑
摘要:1.插入配对 std::vector<pair<int,int> > w; w.push_back(make_pair<int,int>(f,s) ); cout <<w[i].first << " " << w[i].second <<endl; 2.元素去重 std::vector<int> a 阅读全文
posted @ 2016-09-16 13:44 Shiyu_Huang 阅读(256) 评论(0) 推荐(0) 编辑
摘要:1. string转int string str; int Num = atoi(str.c_str()); 2.string转char* string s = "how"; const char *c = s.c_str(); //或s.data();3.in转string#include <ss 阅读全文
posted @ 2016-07-30 05:40 Shiyu_Huang 阅读(173) 评论(0) 推荐(0) 编辑
摘要:1.最精确 QueryPerformanceFrequency(&nFreq); cout <<nFreq.QuadPart<<endl;//获得计数频率 QueryPerformanceCounter(&s);//获取当前计数次数 QueryPerformanceCounter(&e);//获取当 阅读全文
posted @ 2016-04-27 19:27 Shiyu_Huang 阅读(718) 评论(0) 推荐(0) 编辑
摘要:1 /********** 2 TimeCounter.h 3 huangsy13@gmail.com 4 **********/ 5 #ifndef TIMECOUNTER 6 #define TIMECOUNTER 7 8 #include 9 #include 10 ... 阅读全文
posted @ 2015-08-20 21:24 Shiyu_Huang 阅读(380) 评论(0) 推荐(0) 编辑