CHAPTER7-19.cpp
Upload User: fjc899
Upload Date: 2007-07-03
Package Size: 187k
Code Size: 0k
Category:

STL

Development Platform:

C/C++

  1. //文件名:CHAPTER7-19.cpp
  2. #include <deque>
  3. #include <iostream>
  4. #if _MSC_VER > 1020   // if VC++ version is > 4.2
  5.    using namespace std;  // std c++ libs implemented in std
  6. #endif
  7. int main( ) 
  8. {  using namespace std;
  9.    deque <int> c1;
  10.    c1.push_back( 10 );
  11.    c1.push_back( 20 );
  12.    c1.push_back( 30 );
  13.    cout << "The size of the deque is initially " << c1.size( ) << endl;
  14.    c1.clear( );
  15.    cout << "The size of the deque after clearing is " << c1.size( ) << endl;
  16.    return 0;
  17. }