lesson 6 pre post cpp
[[lesson_6_pre_post_cpp]] last edit on Aug 9, 2005 2:10 AM by rescued_by_c

[user02@FC4 Lesson06]$ cat -n pre_post.cpp
   1  #include <iostream>
   2  using namespace std;
   3
   4  int main()
   5  {
   6     int small_count = 0;
   7     int big_count = 1000;
   8
   9     cout << "small_count is " << small_count << endl;
  10     cout << "small_count++ yields " << small_count++ << endl;
  11     cout << "small_count ending value " << small_count << endl;
  12
  13     cout << "big_count is " << big_count << endl;
  14     cout << "++big_count yields " << ++big_count << endl;
  15     cout << "big_count ending value " << big_count << endl;
  16
  17     return 0;
  18  }
[user02@FC4 Lesson06]$ g++ -o pre_post pre_post.cpp
[user02@FC4 Lesson06]$ ./pre_post
small_count is 0
small_count++ yields 0
small_count ending value 1
big_count is 1000
++big_count yields 1001
big_count ending value 1001