//testmyq3.cpp -- using template class MyQueue in myque3.h // CopyLeft by tsaiwn@csie.nctu.edu.tw #include "myque3.h" // 以下的 #ifndef 是用來 check 是否為 GNU 的 g++ ? // 若不是則使用舊式的寫法! 例如 Turbo C++ 3.0 只認識舊式的寫法! #ifndef __GNUG__ #include #else #include using namespace std; #endif ////// ////// ////// ////// ////// ////// int main( ) { MyQueue xo; xo.enque(53); xo.push(770); xo.push(880); while(!xo.empty( ) ) { cout << xo.top( ) << " "; xo.pop( ); } cout << endl; // new line return 0; }