In C++17, consider: enum class Mode { Read = 1, Write = 2 }; int f(int) {…

In C++17, consider: enum class Mode { Read = 1, Write = 2 }; int f(int) { return 10; }; int f(Mode) { return 20; }; int main() { Mode m = Mode::Read; int a = f(m); int b = f(static_cast<int>(m)); }. What are a and b, respectively?

  1. A.

    10 and 20

  2. B.

    20 and 10

  3. C.

    10 and 10

  4. D.

    20 and 20

Attempted by 18 students.

Sign up free to check your answer

Sign up free

Explore the full course: Isro

Loading lesson…