CArray排序
来源:互联网 发布:mac可用的魔兽世界插件 编辑:程序博客网 时间:2024/06/05 06:59
http://www.codeguru.com/forum/archive/index.php/t-215414.html
这篇贴子帮了大忙。有一个回贴这样说到:
#include <algorithm>
...
// Note the *only* change is the template type!
CArray<unsigned char, unsigned char> MyCArray;
//...
std::sort( MyCArray.GetData(), MyCArray.GetData() + MyCArray.GetSize());
It doesn't matter whether it's a CArray of strings, ints, chars, doubles, widgets, or your own class. As long as the items are comparable using operator < (which is what std::sort uses internally), the std::sort will work.
当然,sort()里如果用到自定义比较函数,自己写了。。。
转载出处:http://blog.csdn.net/zhouworld16/article/details/6198347
下载示例:http://download.csdn.net/detail/qq_23992597/9504004
1 0
- CArray排序
- CArray使用qsort排序
- CArray
- CArray
- CArray
- CArray
- CArray
- CArray
- CArray
- CArray
- CArray
- CArray
- CArray
- CArray
- C++ CArray类及子类,使用sort()排序
- C++ CArray类及子类,使用sort()排序 .
- MFC的CArray排序小结(结合std::sort)
- 关于CArray
- poj2891 Strange Way to Express Integers(中国剩余定理)
- HTML——2(HTML 文件的结构)
- android开发步步为营之74:生成facebook注册应用主页需要的Key Hashes
- Android 开发 voip/sip 程序
- 关于开发工具的一些快捷键收集(持续更新)
- CArray排序
- Zookeeper 的学习与运用
- DLL动态链接库的是如何建立的(1)
- oncreate()方法中获得view宽高 观察者模式
- Firefox extension 开发之常用XPCOM service
- C++对象构造函数与析构函数的调用时间问题
- ubuntu12.04 安装 gcc-4.8
- Oracle使用存储过程分页
- Spring自动注入properties文件