⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cpp

📁 数据结构与程序设计教材源码 数据结构与程序设计教材源码
💻 CPP
字号:
 
#include   "../../C/UTILITY.H"
#include   "../../C/UTILITY.CPP"
typedef char Node_entry;
#include   "../NODES/NODE.H"
typedef Node_entry Stack_entry;
#include   "STACK.H"
#include   "../NODES/NODE.CPP"
#include   "STACK.CPP"
 
//  test push and pop functions
main()
{
   char c;
   Stack data;

   data.top(c);
   cout << "Try top on empty stack (expecting garbage): " << c << endl;
   cout << "Push a, b, and c" << endl;
   data.push('a');
   data.push('b');
   data.push('c');
   data.top(c);
   cout << "Top, expecting c: " << c << endl;
   data.pop();
   data.top(c);
   cout << "Pop, Top expecting b: " << c << endl;
   data.pop();
   data.top(c);
   cout << "Pop, Top expecting a: " << c << endl;
   data.pop();
   data.top(c);
   cout << "Tried pop on empty stack (expecting garbage):" << c << endl;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -