您的位置:首页 > 其它

一个使用泛型堆栈模块创建的两个容纳不同类型数据的实例

2007-01-02 02:06 871 查看
/*_############################################################################
  _##
  _##  一个使用泛型堆栈模块创建的两个容纳不同类型数据的实例
  _##  Author: xwlee                        
  _##  Time: 2007.01.02 
  _##  Chang'an University
  _##  Development condition: win2003 Server+VC6.0
  _##
  _##  temp.cpp 文件
  _##########################################################################*/
#include<iostream>
#include <stdlib.h>
#include "stack.h"
using namespace std;

GENERIC_STACK( int, _int, 10 )
GENERIC_STACK( float, _float, 10 )

int main()
{

   
    cout<< "/n=======================================================" << endl;
    push_int( 5 );
    push_int( 22 );
    push_int( 15 );

    push_float( 25.3 );
    push_float( -40.5 );

    while( !is_empty_int() )
    {
        cout << "Popping " << top_int() << endl;
        pop_int();
    }

    while( !is_empty_float() )
    {
        cout << "Popping " << top_float() << endl;
        pop_float();
    }

    return 0;
}
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  float server
相关文章推荐