| |
3.3.1.prefix, postfix, increment, decrement operators |
|
#include <iostream>
int main()
{
int intValue = 39; // initialize two integers
int yourAge = 39;
std::cout << intValue << "\n";
std::cout << yourAge << "\n";
intValue++; // postfix increment
++yourAge; // prefix increment
std::cout << intValue << "\n";
std::cout << yourAge << "\n";
std::cout << intValue++ << "\n";
std::cout << ++yourAge << "\n";
std::cout << intValue << "\n";
std::cout << yourAge << "\n";
return 0;
}
|
|
39
39
40
40
40
41
41
41 |
|