const int MaxVertexes=20; template<class vertexType,class arcType> class Graph; template<class arcType>class ArcNode{ friend class Graph<vertexType,arcType>; private: int adjvex; arcType weight; ArcNode<arcType>*nextarc; ArcNode(){} ArcNode(int v,arcType w):adjvex(v),weight(w),nextarc(NULL){} };
template<class vertexType,class arcType>class VertexNode{ friend class Graph< vertexType,arcType>; private: vertexType data; ArcNode<arcType>*firstarc; }; Compiling... AdjcentTable.cpp D:\AdjcentTable\AdjcentTable.cpp(4) : error C2065: 'vertexType' : undeclared identifier D:\AdjcentTable\AdjcentTable.cpp(11) : see reference to class template instantiation 'ArcNode<arcType>' being compiled 请问上述程序到底错在那里,我找了半天没啥错啊? 多谢了