#include <iostream>
#include <string>
class MainMenu {
public:
MainMenu() = default;
~MainMenu() = default;
void createAccount();
};
class Account {
public:
Account() : firstname("John") {}
~Account() = default;
private:
friend void MainMenu::createAccount();
std::string firstname;
};
void MainMenu::createAccount() {
Account newAccount;
std::cout << newAccount.firstname << '\n';
}
int main() {
MainMenu menu;
menu.createAccount();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKY2xhc3MgTWFpbk1lbnUgewoJcHVibGljOgoJCU1haW5NZW51KCkgPSBkZWZhdWx0OwoJCX5NYWluTWVudSgpID0gZGVmYXVsdDsKCQkKCQl2b2lkIGNyZWF0ZUFjY291bnQoKTsKfTsKCmNsYXNzIEFjY291bnQgewoJcHVibGljOgoJCUFjY291bnQoKSA6IGZpcnN0bmFtZSgiSm9obiIpIHt9CgkJfkFjY291bnQoKSA9IGRlZmF1bHQ7CgkJCglwcml2YXRlOgoJCWZyaWVuZCB2b2lkIE1haW5NZW51OjpjcmVhdGVBY2NvdW50KCk7CgkJc3RkOjpzdHJpbmcgZmlyc3RuYW1lOwp9OwoKdm9pZCBNYWluTWVudTo6Y3JlYXRlQWNjb3VudCgpIHsKCUFjY291bnQgbmV3QWNjb3VudDsKCXN0ZDo6Y291dCA8PCBuZXdBY2NvdW50LmZpcnN0bmFtZSA8PCAnXG4nOwp9CgppbnQgbWFpbigpIHsKCU1haW5NZW51IG1lbnU7CgltZW51LmNyZWF0ZUFjY291bnQoKTsKCQoJcmV0dXJuIDA7Cn0=