LinkStack.h #pragma once #include using namespace std; template class LinkStack; //前置声明 template class ListNode { friend class LinkStack; private: T data; ListNode* next; //私有构造函数 ListNode(const T& theData, ListNode* n=0):data(theData), next(n) {} } ; template class LinkStack { public: LinkS