frntback.CPP
Upload User: dq031136
Upload Date: 2022-08-08
Package Size: 802k
Code Size: 0k
Development Platform:

C++ Builder

  1. #ifdef __BCPLUSPLUS__
  2. #include <list.h>
  3. #else
  4. #include <list>
  5. #endif
  6. #include <string.h>
  7. #include <iostream.h>
  8. using namespace std;
  9. typedef list<string> LISTSTR;
  10. void main(void)
  11.  {
  12.    LISTSTR test;
  13.    test.push_back("back");
  14.    test.push_front("middle");
  15.    test.push_front("front");
  16.    cout << test.front() << endl; // front
  17.    cout << test.back() << endl; // back
  18.    test.pop_front();
  19.    test.pop_back();
  20.    cout << test.front() << endl; // middle
  21.  }