#include <iostream>
#include <string>
using namespace std;
int main() {
string &ref = *new string("teste");
//string &ref2 = nullptr;
string *ptr = new string("teste");
cout << ref << endl;
cout << ref.length() << endl;
cout << ptr->length() << endl;
cout << &ref << endl;
cout << ptr;
}
//https://pt.stackoverflow.com/q/328683/101
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglzdHJpbmcgJnJlZiA9ICpuZXcgc3RyaW5nKCJ0ZXN0ZSIpOwoJLy9zdHJpbmcgJnJlZjIgPSBudWxscHRyOwoJc3RyaW5nICpwdHIgPSBuZXcgc3RyaW5nKCJ0ZXN0ZSIpOwoJY291dCA8PCByZWYgPDwgZW5kbDsKCWNvdXQgPDwgcmVmLmxlbmd0aCgpIDw8IGVuZGw7Cgljb3V0IDw8IHB0ci0+bGVuZ3RoKCkgPDwgZW5kbDsKCWNvdXQgPDwgJnJlZiA8PCBlbmRsOwoJY291dCA8PCBwdHI7Cn0KCi8vaHR0cHM6Ly9wdC5zdGFja292ZXJmbG93LmNvbS9xLzMyODY4My8xMDE=