I was trying to post a question to stackoverflowStack Overflow but I can not because it "doesn't meet quality standards".
doesn't meet quality standards
How can I know what need to be fixed in my question so it become "meeting quality standards"? Adding question below, thanks!
In c++ I can declare field as regular variable of some type, instatiate it in constructor, and use it later:
private: Foo field; ... A::A() { field = FieldImpl(); } .... method(field);
Or alternatively i can use pointer:
private: Foo* field; ... A::A() { field = new FieldImpl(); } A::~A() { delete field; } ... method(*field);
What is prons and cons of declaring field as pointer? When declaring field how to decide if I should use pointer or regular variable?