swapmain.pgm
Upload User: qdkongtiao
Upload Date: 2022-06-29
Package Size: 356k
Code Size: 0k
Category:

source in ebook

Development Platform:

Visual C++

  1. #include <iostream>
  2. using std::cout;
  3. using std::endl;
  4. int main() 
  5. {
  6.     int i = 10;
  7.     int j = 20;
  8.     cout << "Before swap():ti: "
  9.          << i << "tj: " << j << endl;
  10.     swap(i, j);
  11.     cout << "After  swap():ti: "
  12.          << i << "tj: " << j << endl;
  13.     return 0;
  14. }