- 博客(7)
- 资源 (4)
- 问答 (2)
- 收藏
- 关注
原创 顺序容器的简单初始化
#include #include #include #include #include #include using namespace std;int main(){vector cv1 = {"a","an","the","is","computer"};vector cv2(cv1);//用相同类型的容器,以及容器元素类型都是一致 初始化。
2017-01-17 16:44:59 295
原创 函数指针与函数指针数组的简单理解以及vector
#include #include using namespace std;//startint add(int const &a, int const &b){int temp = 0;temp = a + b;return temp;}int sub(int const &a, int const &b){int temp = 0;t
2017-01-16 14:30:42 660
原创 initializer_list 简单使用
#include #include using namespace std;//可变形参函数(同类型),用列表的形式传参int sum(initializer_list li)//sum函数接受一个initialzer_list的对象,计算列表中所有元素的和{int tmp = 0;for(const auto &a: li)//范围for循坏{tmp += a
2017-01-15 10:09:01 1363
原创 随心记1
当你抱有较大希望去做一件事情时,在做的过程中,你发现,与你想象中的有些差距。这个时候,你的心情大都不怎么好,会失落,会往自己身上找各种问题。然后怪自己,当初的选择或是判断怎么就那么差劲。直到后来,这件事情慢慢的被时间冲刷,或者一个小时,一天,或者一个月,你变得不再记起这件令你有的难堪的往事。我知道,每个人都会遇到这种状态,说不出是好还是不好。我看到那些表面看
2017-01-12 18:54:40 249
原创 throw 与 try 和catch 的简单尝试
#include using namespace std;int main(){int num1 = 0, num2 = 0;while (cin >> num1 >> num2)//C++Primer 连续输入两个整数,用第一个去除第二个,然后输出。{try{ // try 与下面的 catch ,将一段可能出现异常的语句 括在花括号 内。
2017-01-08 12:05:04 294
原创 查找string中单词的个数
#include #include #include #include using namespace std;int Sum(string s){int num = 0;for (decltype(s.size()) index = 0; index != s.size(); ++index){if (isspace(s[index]))
2017-01-06 20:34:41 1477
原创 string与vector
#include #include #include #include using namespace std;int main1(){string s("do something string");//直接初始化一个string字符串if (!s.empty()){s[0] = toupper(s[0]);//将首字母(使用下标)转换大写}
2017-01-06 10:08:29 394
Mtcnn-ubuntu-Cmake
2019-04-12
Qt与basler驱动的融合
2016-07-21
TA创建的收藏夹 TA关注的收藏夹
TA关注的人