C++20 sections · 1024 units
Open in CourseQuiz: Reference Behavior
Predicting results
Check Your Understanding
What prints? int x = 10; int& r1 = x; int& r2 = r1; r2 = 20; cout << x;
- A.20
- B.10
- C.Compiler error
- D.Undefined behavior
Predicting results
What prints? int x = 10; int& r1 = x; int& r2 = r1; r2 = 20; cout << x;