![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++
ALZq
这个作者很懒,什么都没留下…
展开
-
列表初始化之 object[ { arg1, arg2, ... } ]
今天网上翻资料发现居然有: object[ { arg1, arg2, ... } ]这种写法(在下标表达式中使用用户定义的 operator[] ,其中列表初始化初始化重载运算符的参数)。于是决定自己写代码试试。 struct Foo { int x[10]; int& operator [](initializer_list l) { int sub = 0; for (au原创 2017-10-27 12:32:45 · 635 阅读 · 0 评论 -
排序算法
突然发现自己对排序算法陌生的很, 趁这几天有空, 翻了网上的资料, 自己写了一遍排序算法, 把自己写的记录下来, 供以后回顾. #include #include using namespace std; // 通用输出函数 void PrintArray(int a[], int n, char* prefix = "") { printf("\n==========%s======原创 2017-10-29 23:01:33 · 213 阅读 · 0 评论