#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <string.h>
using namespace std;
void func(string * str)
{
char ch[16] = { 0 };
reverse(str->begin(), str->end());
memcpy( ch, str->c_str(), 16 ); // charにする縛りでもあるの??
*str = static_cast<string>(ch);
}
int main(void)
{
string str("pop'n candy!");
cout << str << endl;
func( &str );
cout << str << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8c3RyaW5nLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdm9pZCBmdW5jKHN0cmluZyAqIHN0cikKewogICAgY2hhciBjaFsxNl0gPSB7IDAgfTsKICAgIHJldmVyc2Uoc3RyLT5iZWdpbigpLCBzdHItPmVuZCgpKTsKICAgIG1lbWNweSggY2gsIHN0ci0+Y19zdHIoKSwgMTYgKTsgLy8gY2hhcuOBq+OBmeOCi+e4m+OCiuOBp+OCguOBguOCi+OBru+8n++8nwogICAgKnN0ciA9IHN0YXRpY19jYXN0PHN0cmluZz4oY2gpOwp9CgppbnQgbWFpbih2b2lkKQp7CiAgICBzdHJpbmcgc3RyKCJwb3AnbiBjYW5keSEiKTsKICAgIGNvdXQgPDwgc3RyIDw8IGVuZGw7CiAgICBmdW5jKCAmc3RyICk7CiAgICBjb3V0IDw8IHN0ciA8PCBlbmRsOwoKICAgIHJldHVybiAwOwp9Cg==