C++20 sections · 1024 units
Open in Course

Quiz: Const References

Understanding restrictions

Check Your Understanding

Which line causes a compiler error? void test(const int& x) { cout << x; int y = x; x = 10; int& r = x; }

  1. A.x = 10 and int& r = x
  2. B.int y = x
  3. C.cout << x
  4. D.All statements
Start the roadmap to answer the quizzes and solve the challenges