单项选择题

有如下程序: #include using namespace std; class Cup{ public: Cup(double val=5.8):price(val) { } void SetPrice(double val) { price=val; } double GetPrice() const { return price;} private: double price; }; int main(){ const Cup c1(4.5); Cup c2(29.8); c1.SetPrice(5.8); //① c2.SetPrice(12.8); //② c1.GetPrice(); //③ c2.GetPrice(); //④ return 0; } 在标注号码的语句行中存在语法错误的是

A.①
B.②
C.③
D.④
题目列表

你可能感兴趣的试题

微信扫码免费搜题