Would there be any benefit in this pointless example to having the data of ObjectTwo be declared separately on the heap? Is not the member from ObjectOne not on the free strore? What is/are the difference(s) aside from how you access said data?
Code:class ObjectOne { public: int data; }; class ObjectTwo { ObjectTwo() {data = new int;} ~ObjectTwo() { delete data; } int * data; }; int main() { ObjectOne * classOne = new ObjectOne(); ObjectTwo * classTwo = new ObjectTwo(); delete classOne; delete classTwo; return 0; }