C++ Question: using
このコードを見てください.
実行結果はどうなりますか?
A. B::f
B.#1コンパイルエラー
C.#2コンパイルエラー
D.#3コンパイルエラー
#include <stdio.h>
struct A {
void f() { printf("A::f
"); }
};
struct B : A {
using A::f; // #1
void f() { printf("B::f
"); } // #2
};
int main() {
B().f(); #3
return 0;
}
実行結果はどうなりますか?
A. B::f
B.#1コンパイルエラー
C.#2コンパイルエラー
D.#3コンパイルエラー