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?
- A.
10 and 20
- B.
20 and 10
- C.
10 and 10
- D.
20 and 20
Attempted by 18 students.
Sign up free to check your answer
Sign up freeLoading lesson…

