#include <string>
#include <iostream>
using namespace std;
int main()
{
string data("0123456789");
cout << "Na poczarku: " << data << "\n";
char* ptr = (char*) data.c_str();
ptr[3]='x';
cout << "Po zmodyfikowaniu (c_str()): " << data << "\n";
ptr = (char*) data.data();
ptr[5]='x';
cout << "Po zmodyfikowaniu (data()): " << data << "\n";
return 0;
}
I2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKQp7CiAgICBzdHJpbmcgZGF0YSgiMDEyMzQ1Njc4OSIpOwogICAgY291dCA8PCAiTmEgcG9jemFya3U6ICIgPDwgZGF0YSA8PCAiXG4iOwogICAgY2hhciogcHRyID0gKGNoYXIqKSBkYXRhLmNfc3RyKCk7CiAgICBwdHJbM109J3gnOwogICAgY291dCA8PCAiUG8gem1vZHlmaWtvd2FuaXUgKGNfc3RyKCkpOiAiIDw8IGRhdGEgPDwgIlxuIjsKICAgIHB0ciA9IChjaGFyKikgZGF0YS5kYXRhKCk7CiAgICBwdHJbNV09J3gnOwogICAgY291dCA8PCAiUG8gem1vZHlmaWtvd2FuaXUgKGRhdGEoKSk6ICIgPDwgZGF0YSA8PCAiXG4iOwogICAgcmV0dXJuIDA7Cn0=