免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2309 | 回复: 6
打印 上一主题 下一主题

在unix下编程有没有类似MFC的CPtrList类功能的东东呀? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-06-02 13:12 |只看该作者 |倒序浏览
如题,急!!!!谢了先!

论坛徽章:
0
2 [报告]
发表于 2003-06-02 18:03 |只看该作者

在unix下编程有没有类似MFC的CPtrList类功能的东东呀?

stl的list

list<指针>;

论坛徽章:
0
3 [报告]
发表于 2003-06-16 00:38 |只看该作者

在unix下编程有没有类似MFC的CPtrList类功能的东东呀?

原帖由 "无双" 发表:
stl的list

list<指针>;
   

无双兄,能否写个实例看看

论坛徽章:
0
4 [报告]
发表于 2003-06-16 10:58 |只看该作者

在unix下编程有没有类似MFC的CPtrList类功能的东东呀?

// list_list.cpp
// compile with: /EHsc
// Demonstrates the different constructors for list<T>;

#pragma warning (disable:4786)
#include <list>;
#include <string>;
#include <iostream>;

using namespace std ;

typedef list<string>; LISTSTR;

// Try each of the four constructors
int main()
{
    LISTSTR::iterator i;
    LISTSTR test;                   // default constructor

    test.insert(test.end(), "one";
    test.insert(test.end(), "two";

    LISTSTR test2(test);            // construct from another list
    LISTSTR test3(3, "three";      // add several <T>;'s
    LISTSTR test4(++test3.begin(),  // add part of another list
             test3.end());

    // Print them all out

    // one two
    cout << "test:";
    for (i =  test.begin(); i != test.end(); ++i)
        cout << " " << *i;
    cout << endl;

    // one two
    cout << "test:";
    for (i =  test2.begin(); i != test2.end(); ++i)
        cout << " " << *i;
    cout << endl;

    // three three three
    cout << "test:";
    for (i =  test3.begin(); i != test3.end(); ++i)
        cout << " " << *i;
    cout << endl;

    // three three
    cout << "test:";
    for (i =  test4.begin(); i != test4.end(); ++i)
        cout << " " << *i;
    cout << endl;
}

论坛徽章:
0
5 [报告]
发表于 2003-06-16 11:13 |只看该作者

在unix下编程有没有类似MFC的CPtrList类功能的东东呀?

xuejm兄,能否再详细讲解一下list的定义和使用?

论坛徽章:
0
6 [报告]
发表于 2003-06-16 11:36 |只看该作者

在unix下编程有没有类似MFC的CPtrList类功能的东东呀?

google找了没有

论坛徽章:
0
7 [报告]
发表于 2003-06-16 11:51 |只看该作者

在unix下编程有没有类似MFC的CPtrList类功能的东东呀?

无双老大不要打击偶的积极性哟。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP