b***y 发帖数: 2799 | 1 ☆─────────────────────────────────────☆
qxc (睡觉自然醒, 数钱手抽筋) 于 (Tue Aug 23 18:18:35 2005) 提到:
compiler 老抱怨说我不能把一个 const 的 string 设置成为 static member,
VS2005.
这里面有什么逻辑原因吗? 多谢。
☆─────────────────────────────────────☆
aZhu (a+zhu) 于 (Tue Aug 23 18:23:43 2005) 提到:
I guess you initialize it inside the class.
i think you can't
though
class A{
static const int = 7;
// ..
}
is legal,
class A{
static const string a = "aaa";
//...
}
is not ba?
☆─────────────────────────────────────☆
yunhai (飞纵 | E*****7 发帖数: 128 | 2 WRONG: const data member of a class can be static!
(Comment: there are many misleading answers given by other persons in your original post.They are really misleading!) | c*******g 发帖数: 771 | |
|