Bruce Eckel's Thinking in C++, 2nd Ed | Contents | Prev | Next |
//: C03:AutoIncrement.cpp // Shows use of auto-increment // and auto-decrement operators. #include <iostream> using namespace std; int main() { int i = 0; int j = 0; cout << ++i << endl; // Pre-increment cout << j++ << endl; // Post-increment cout << --i << endl; // Pre-decrement cout << j-- << endl; // Post decrement } ///:~