Consider the class definition:
```
class IntPair{ int first; int second;public:
IntPair(int firstValue, int secondValue);// prefix
operator++ here
// postfix operator ++ here
int getFirst( ) const;
int getSecond( ) const;
```
a) Give declarations for prefix and postfix versions of operator++
b) Give definitions for prefix and postfix versions of operator++
a) declarations:
```
const IntPair operator++( ); //Prefix versionconst
IntPair operator++(int); //Postfix version
```
b) definitions.
```
//prefix version
const IntPair IntPair::operator++( )
{
first++;
second++; return IntPair(first, second);}
//postfix versionconst IntPair IntPair::operator++(int
ignoreMe) { int temp1 = first;
int temp2 = second;
first++;
second++;
return IntPair(temp1, temp2);
```
You might also like to view...
The __________ incorporates routines that allow the user or programmer to create, delete, modify, and manipulate files logically, by name.
a. BIOS b. file system c. PICOS d. user interface
Match the following terms to their meanings:
I. Themes II. Page Header III. Expression IV. Calculated field V. Page Footer A. Displays at the bottom of every printed page B. Simplifies the process of creating professional-looking objects C. Contains the field name, followed by a colon and expression D. The existing field names must be enclosed in square brackets E. Displays at the top of every printed page
Clicking on the row selector box selects an entire ________ in a data source
Fill in the blank(s) with correct word
A ____ is a character that alters the way a pattern match occurs.
A. Character class B. Pattern class C. Metacharacter D. Metaword