I have this piece of code that allocates and constructs an object:
#include <iostream>
#include <new>
struct MyClass {
int data;
};
int main () {
struct MyClass *p1=new MyClass;
return 0;
}
So,if i understand correctly p1 is a pointer to a memory location where a Myclass Object is stored.So if i want for this particular object to update the int data value how can i do it?