![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
程序
MQLcsdn
这个作者很懒,什么都没留下…
展开
-
C++ 静态成员函数和lambda表达式的一些探索
故事的开始,从牛客网一道题目说起。输入一个正整数数组,把数组里所有数字拼接起来排成一个数,打印能拼接出的所有数字中最小的一个。例如输入数组{3,32,321},则打印出这三个数字能排成的最小数字为321323。题目怎么求解暂且不表,现在visual studio 2017中写好代码,如下:bool mCmp(const string& s1, const string &...原创 2020-02-04 11:30:45 · 1416 阅读 · 0 评论 -
C++ STL中的堆(heap)排序的一些探索
偶然遇到了一个可用堆排序解决的问题,查了一下,STL库中自带简单的堆排序。直接上代码:#include "stdafx.h"#include<algorithm>#include<vector>#include<iostream>using namespace std;void print_vec(const vector<int&g...原创 2020-02-02 12:38:38 · 634 阅读 · 0 评论 -
C++ multiset的一些探索
偶然遇见平时不常用的一个容器multiset。直接上代码:#include "stdafx.h"#include<set>#include<iostream>using namespace std;template<typename T>using mset = multiset<T>;int main(){ mset<...原创 2020-02-01 23:35:30 · 198 阅读 · 0 评论 -
C++ char*作为返回值的一些探索
事情是这样的,先看下面一段代码:int main(){ string str = "hell world"; char* pc = &str[0]; cout << pc << endl; return 0;}输出很正常,hello world。-------------------------------------------一条没有...原创 2020-01-28 22:01:44 · 3881 阅读 · 3 评论 -
C++ 函数指针的一点探索
void Test0(int n) { cout << n << endl;}void Test1() { cout << "hello,C++" << endl;}void FuncPointTest0(void (*func)(int n)) { func(5);}void FuncPointTest1(void(*fu...原创 2020-01-19 22:52:34 · 99 阅读 · 0 评论 -
C++ 正则表达式的一些探索
学习一下C++ 正则表达式的使用。int main(){ string s = "123abc456def789ghi"; regex r("[0-9]{3}"); string::const_iterator iterStart = s.begin(); string::const_iterator iterEnd = s.end(); smatch result; ...原创 2020-01-18 23:51:34 · 163 阅读 · 0 评论