December 2001
Intermediate to advanced
304 pages
6h 25m
English
Difficulty: 5
Can subtle code differences really matter, especially in something as simple as postincrementing a function parameter? This Item explores an interesting interaction that becomes important in STL-style code.
Describe what the following code does:
// Example 9-1 // f( a++ );
Be as complete as you can about all possibilities.
What is the difference, if any, between the following two code fragments?
// Example 9-2(a) // f( a++ ); // Example 9-2(b) // f( a ); a++;
In Question #2, make the simplifying assumption that f() is a function that takes its argument by value, and that a is an object of class type that has an operator++(int) with natural semantics. Now what is the difference, if any, between Example 9-2(a) ...
Read now
Unlock full access