lesson 6 deccount cpp
[[lesson_6_deccount_cpp]] last edit on Aug 18, 2005 6:17 AM by rescued_by_c

[user02@FC4 Lesson06]$ cat -n deccount.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 deccount deccount.cpp
[user02@FC4 Lesson06]$ ./deccount
small_count is 0
small_count-- yields 0
small_count ending value -1
big_count is 1000
--big_count yields 999
big_count ending value 999