class CBAY_ITEM
{
public:
string name = enterName();
string condition = enterCondition();
};
当我编译时,它给出了 4 个错误,它们说
1.a function call cannot appear in a constant-expression
2.ISO C++ forbids initialization of member 'name'
3.making 'name' static
4.invalid in-class initialization of static data member of non-integral type 'std::string'
我在这里做错了什么?