![](https://static.youtibao.com/asksite/comm/h5/images/m_q_title.png)
有如下类定义:class Bag {public:Bag(int p,char s='M'):price(p),size(s) { count++
有如下类定义:
class Bag {
public:
Bag(int p,char s='M'):price(p),size(s) { count++; }
~Bag() { count--; }
int GetPrice() { return price; }
int GetPrice() const { return price; }
void SetPrice(int val) const { price=val; }
private:
int price;
char size;
static int count;
};
下列关于类成员的叙述中,正确的是()。
A. 成员函数GetPrice存在重定义
B.构造函数的参数不能设置默认值
C.析构函数中不能访问静态数据成员
D.成员函数SetPrice不能定义为常函数
![](https://static.youtibao.com/asksite/comm/h5/images/solist_ts.png)