#include <cassert>
#include <iostream>
#include <string>
class namegen
{
public:
std::string name;
namegen()
{
name="truble";
};
};
int main()
{
namegen n;
std::cout<<"строка n.name равна = "<<n.name<<std::endl;
std::string::size_type const capacity = n.name.capacity();
n.name.clear();
assert(capacity == n.name.capacity());
assert(n.name.empty());
assert(0 == n.name.size());
std::cout<<"строка n.name после удаления равна = "<<n.name;
std::cout<<std::endl<<"выводим символ по порядковому номеру = "<<n.name[1];
return 0;
}
I2luY2x1ZGUgPGNhc3NlcnQ+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHN0cmluZz4KY2xhc3MgbmFtZWdlbgp7CglwdWJsaWM6CglzdGQ6OnN0cmluZyBuYW1lOwoJbmFtZWdlbigpCnsKCW5hbWU9InRydWJsZSI7Cn07Cn07CgppbnQgbWFpbigpCnsKCW5hbWVnZW4gbjsKCXN0ZDo6Y291dDw8ItGB0YLRgNC+0LrQsCBuLm5hbWUg0YDQsNCy0L3QsCA9ICI8PG4ubmFtZTw8c3RkOjplbmRsOwoJc3RkOjpzdHJpbmc6OnNpemVfdHlwZSBjb25zdCBjYXBhY2l0eSA9IG4ubmFtZS5jYXBhY2l0eSgpOwogCiAgICBuLm5hbWUuY2xlYXIoKTsKICAgIGFzc2VydChjYXBhY2l0eSA9PSBuLm5hbWUuY2FwYWNpdHkoKSk7CiAgICBhc3NlcnQobi5uYW1lLmVtcHR5KCkpOwogICAgYXNzZXJ0KDAgPT0gbi5uYW1lLnNpemUoKSk7CglzdGQ6OmNvdXQ8PCLRgdGC0YDQvtC60LAgbi5uYW1lINC/0L7RgdC70LUg0YPQtNCw0LvQtdC90LjRjyDRgNCw0LLQvdCwID0gIjw8bi5uYW1lOwoJc3RkOjpjb3V0PDxzdGQ6OmVuZGw8PCLQstGL0LLQvtC00LjQvCDRgdC40LzQstC+0Lsg0L/QviDQv9C+0YDRj9C00LrQvtCy0L7QvNGDINC90L7QvNC10YDRgyA9ICI8PG4ubmFtZVsxXTsKcmV0dXJuIDA7Cn0=