摘要: //栈中使用类模版例子#include <iostream>#include <typeinfo>using namespace std;//typedef char T;template<typename T,int len=4>//可以有默认值,有默认值的参数靠右//如果成员函数在类外写,那么每个函数前要加语句: template<typename T> class Stack{ T a[len]; int cur;public: Stack():cur(0){} const char* stype()const//类型 { return t 阅读全文
posted @ 2012-10-12 10:51 真爱无限 阅读(234) 评论(0) 推荐(0) 编辑