摘要:
今天,小菜帮网友调试了个小程序,不想浪费就贴出来了。代码的用途:存在一个类Person,产生一系列的对象,要求按年龄从小到大对对象数组进行排序,一般情况下,对象较小时可以vector处理,但对象较大时,很浪费内存,用vector处理较为合理,但两个版本有细微的差别,代码如下,希望对各位有用。// 处理指针数组的情况#include #include #include #include #include using namespace std;class Person { public: int age; string name; public: //... Person(){}... 阅读全文
posted @ 2011-09-15 20:59
narutoinfo
阅读(169)
评论(0)
推荐(0)

浙公网安备 33010602011771号