#include <iostream>
#include <vector>
using namespace std;
struct Data{
int m;
double u;
long f;
Data(int kj, double lh, long fg)
{
m = kj;
u = lh;
f = fg;
}
Data& operator= (const Data& mydat)
{
m = mydat.m;
u = mydat.u;
f = mydat.f;
return *this;
}
};
struct Example
{
vector <Data> m;
string k;
Example (string info, Data* data)
{
m.push_back(Data(2,-9.32322,-324332));
k = info; *data = m.back();
}
~Example()
{
cout << "Deleted!\n";
}
};
int main()
{
Data* flv = new Data(1,2,3);
std::cout << flv->m << std::endl;
Example doesnotwork("", flv);
std::cout << flv->m << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgogCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiAKc3RydWN0IERhdGF7CiAgICBpbnQgbTsKICAgIGRvdWJsZSB1OwogICAgbG9uZyBmOwogICAgCiAgICBEYXRhKGludCBraiwgZG91YmxlIGxoLCBsb25nIGZnKQogICAgewogICAgICAgIG0gPSBrajsKICAgICAgICB1ID0gbGg7CiAgICAgICAgZiA9IGZnOwogICAgfQogICAgCiAgICBEYXRhJiBvcGVyYXRvcj0gKGNvbnN0IERhdGEmIG15ZGF0KQogICAgewogICAgICAgIG0gPSBteWRhdC5tOwogICAgICAgIHUgPSBteWRhdC51OwogICAgICAgIGYgPSBteWRhdC5mOwogICAgICAgIAogICAgICAgIHJldHVybiAqdGhpczsKICAgIH0KfTsKIApzdHJ1Y3QgRXhhbXBsZQp7CiAgICB2ZWN0b3IgPERhdGE+IG07CiAgICBzdHJpbmcgazsKICAgIAogICAgRXhhbXBsZSAoc3RyaW5nIGluZm8sIERhdGEqIGRhdGEpCiAgICB7CiAgICAgICAgbS5wdXNoX2JhY2soRGF0YSgyLC05LjMyMzIyLC0zMjQzMzIpKTsKICAgICAgICBrID0gaW5mbzsgKmRhdGEgPSBtLmJhY2soKTsKICAgIH0KICAgIAogICAgfkV4YW1wbGUoKQogICAgewogICAgICAgIGNvdXQgPDwgIkRlbGV0ZWQhXG4iOwogICAgfQp9OwogCmludCBtYWluKCkKewogICAgRGF0YSogZmx2ID0gbmV3IERhdGEoMSwyLDMpOwogICAgc3RkOjpjb3V0IDw8IGZsdi0+bSA8PCBzdGQ6OmVuZGw7CiAgICBFeGFtcGxlIGRvZXNub3R3b3JrKCIiLCBmbHYpOwogICAgc3RkOjpjb3V0IDw8IGZsdi0+bSA8PCBzdGQ6OmVuZGw7CiAgICByZXR1cm4gMDsKfQ==