1

I want to initialize string member of Test_class with "Empty string". And I don't understand why this code is wrong

class Test_class{
private:
    std::string string_01 ("Empty string");
};

and this works well

class Test_class{
private:
    std::string string_01 = "Empty string";
};
Denis
  • 19
  • 2

0 Answers0