#include using namespace std; struct Example { int a; Example(int b); void printA(); }; Example::Example(int b) { a = b; } void Example::printA() { cout << "a = " << a<printA(); //ex1.printA(); Will not compile ex2.printA(); delete ex1; /* only ex1 needs to be explicitly deleted, since it's dynamically allocated. */ }