正在加载图片...
Class Declaration Definition class STack l/class declaration lf class definition body public: laccess control bool push(const string&); //member function declaration bool pop(string &) bool peek(string &) bool empty(; bool fullO: line automatically int size(i return m_stack size(; ) //declaration definition(in Class) private: ∥/ access control vector<string> m stack; //data member ; Class scope resolution /never to forget the semicolon bool STack; empty /member function definition (out i return m stack. empty 0; y of Class)Class Declaration & Definition class CStack { public: bool push(const string&); bool pop(string &); bool peek(string &); bool empty(); bool full(); int size() { return m_stack.size(); } private: vector<string> m_stack; }; bool CStack::empty() { return m_stack.empty(); } //class declaration //{} class definition body //access control //member function declaration //declaration & definition (in Class) // access control //data member //never to forget the semicolon //member function definition (out of Class) inline automatically Class scope resolution
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有