请教C++模板类问题,VC6.0环境下

来源:互联网 发布:工商网络监管 心得体会 编辑:程序博客网 时间:2024/05/08 01:25

// Example of the template keyword
template <class T, int i> class TestClass {
public:
   char buffer[i];
   T testFunc(T* p1 );
};

template <class T, int i>
T TestClass<T,i>::testFunc(T* p1) {
    return *(p1++)
};

// To create an instance of TestClass
TestClass<char, 5> ClassInst;
以上程序编译通过,但是连接有问题,请教高手

原创粉丝点击