Operator Overloading C++ Flashcards

(8 cards)

1
Q

Arithmatic and relational operators

A

(bool / objectType) operator#(const className&) const;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Stream insertion / extraction operators

A

friend xstream& operator#(xstream&, const className&);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Assignment operator

A

const className& operator=(const className&);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Pre increment / decrement operator

A

className operator#();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Post increment / decrement operator

A

className operator#(int);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Nonconstant array subscript

A

Type& operator[](int index};

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Constant array subscript

A

const Type& operator[](int index} const;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Post increment algorithm

A
  1. Make a copy of the data in question
  2. Increment the current object
  3. Return the copied value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly