#include <iostream>
using namespace std;
class Simple
{
public:
Simple()
{
mIntPtr = new int();
}
~Simple()
{
delete mIntPtr;
}
void setIntPtr(int inInt)
{
*mIntPtr = inInt;
}
void go()
{
cout << "Herllo there" << endl;
}
protected:
int* mIntPtr;
};
void doSomething(Simple*& outSimplePtr)
{
outSimplePtr = new Simple();
}
int main(int argc, char** argv) {
Simple* simplePtr = new Simple();
doSomething(simplePtr);
delete simplePtr;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwpjbGFzcyBTaW1wbGUKewoJcHVibGljOgoJU2ltcGxlKCkKCXsKCQltSW50UHRyID0gbmV3IGludCgpOwoJfQp+U2ltcGxlKCkKewoJZGVsZXRlIG1JbnRQdHI7Cn0Kdm9pZCBzZXRJbnRQdHIoaW50IGluSW50KQp7CgkqbUludFB0ciA9IGluSW50Owp9CnZvaWQgZ28oKQp7Cgljb3V0IDw8ICJIZXJsbG8gdGhlcmUiIDw8IGVuZGw7Cn0KcHJvdGVjdGVkOgppbnQqIG1JbnRQdHI7Cn07CnZvaWQgZG9Tb21ldGhpbmcoU2ltcGxlKiYgb3V0U2ltcGxlUHRyKQp7CglvdXRTaW1wbGVQdHIgPSBuZXcgU2ltcGxlKCk7Cn0KCmludCBtYWluKGludCBhcmdjLCBjaGFyKiogYXJndikgewoJU2ltcGxlKiBzaW1wbGVQdHIgPSBuZXcgU2ltcGxlKCk7Cglkb1NvbWV0aGluZyhzaW1wbGVQdHIpOwoJZGVsZXRlIHNpbXBsZVB0cjsKfQ==