Suppose that you want to develop two different + operators that calculate and re
ID: 3538593 • Letter: S
Question
- Suppose that you want to develop two different + operators that calculate and return an object of some class. Which statement is correct?
- A. One operator must be a friend and the other must not.
- B. One operator must be public and the other private.
- C. The operators must have a different parameter lists.
- D. It is not possible to have two different + operators.
- What is printed by these statements?
int i = 1; int k = 2; int *p1; int *p2; p1 = &i; p2 = &k; p1 = p2; *p1 = 3; *p2 = 4; cout << i;
- A. 1
- B. 2
- C. 3
- D. 4
Explanation / Answer
1.
The correct option is C.
Explanation:
2.
The correct option is A.
Explanation:
cout << i;
Hence, the printed value is 1.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.