我用的是vc6, 定义一个类,在头文件中声明成员函数,在源文件中实现成员函数,在源文件中include 了头文件,打“::”时也会出现成员项,但是双击ClassView中的函数时,却找不到函数的定义。我用的是template,比如:
头文件中声明,
void Push(const elemType &item);
源文件中,
template <class elemType>
void Stack<elemType>::Push(const elemType &item)
{
if(top==MaxStackSize-1)
{
cerr << "error, full" << endl;
exit(1);
} top++;
stacklist[top] = item;
}请问出现这种情况是怎么回事呢?谢谢
头文件中声明,
void Push(const elemType &item);
源文件中,
template <class elemType>
void Stack<elemType>::Push(const elemType &item)
{
if(top==MaxStackSize-1)
{
cerr << "error, full" << endl;
exit(1);
} top++;
stacklist[top] = item;
}请问出现这种情况是怎么回事呢?谢谢
试一试!