有如下定义,在标注号码的行中,能被正确编译的是。c
有如下定义,在标注号码的行中,能被正确编译的是()。
class Test
{
public:
Test() { a=0; c=0; } //①
int f(int a) const { this->a =a; } //②
static int g() { return a; } //③
void h(int b) { Test::b =b; } //④
private:
int a;
static int b;
const int c;
};
int Test::b=0;答案
D