I have the TestObject class:
public:
TestObject() {}
std::string name;
In main function I do this
TestObject *to = new TestObject();
std::string t = "r";
to->name = t;
printf("%s",t);
I need to save simple string in name file on class object, but I'm doing with the wrong way. What is the solution?