wctest8.cpp

来自「开放源码的编译器open watcom 1.6.0版的源代码」· C++ 代码 · 共 54 行

CPP
54
字号
#include <wclist.h>
#include <iostream.h>

static void test1();
static void test2();

int main() {
    test1();
    test2();
    return( 0 );
}


void test1() {
    WCValSList<int>     list;
    WCValSList<int>     list2;

    list.insert( 2 );
    list.insert( 1 );
    list.insert( 5 );
    list2 = list;
    int data;
    while( !list.isEmpty() ) {
        data = list.get();
        cout << data << "\n";
    };
    while( !list2.isEmpty() ) {
        data = list2.get();
        cout << data << "\n";
    };
    cout.flush();
}


void test2() {
    WCValDList<int>     list;
    WCValDList<int>     list2;

    list.insert( 2 );
    list.insert( 1 );
    list.insert( 5 );
    list2 = list;
    int data;
    while( !list.isEmpty() ) {
        data = list.get();
        cout << data << "\n";
    };
    while( !list2.isEmpty() ) {
        data = list2.get();
        cout << data << "\n";
    };
    cout.flush();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?