int main( void ) { std::cout << "Let's make some ponies !" << std::endl; ponyOnTheHeap(); ponyOnTheStack(); std::cout << "At least we had fun ..." << std::endl; return 0; }
int main(void) { std::cout << "<Main> Creating a Pony on the Heap" << std::endl; ponyOnTheHeap(); std::cout << "<Main> Pony on the Heap doesn't exist anymore" << std::endl << std::endl; std::cout << "<Main> Creating a Pony on the Stack" << std::endl; ponyOnTheStack(); std::cout << "<Main> Pony on the Stack doesn't exist anymore" << std::endl; return (0); }
int main() { Pony *pony; pony = ponyOnTheHeap(); ponyOnTheStack(); std::cout << "The pony on the Heap have to die too !" << std::endl; delete pony; return 0; }