#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 );
string tmp = *str;
reverse(tmp.begin(), tmp.end());
memcpy( ch, tmp.c_str(), 16 );
*str = static_cast<string>(ch);
}
int main(void)
{
string str("pop'n candy!");
cout << str << endl;
func( &str );
cout << str << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8c3RyaW5nLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdm9pZCBmdW5jKHN0cmluZyAqIHN0cikKewogICAgY2hhciBjaFsxNl0gPSB7IDAgfTsKICAgIC8vIOOBp+OBjeOBquOBhAogICAgLy8gcmV2ZXJzZSgqc3RyLmJlZ2luKCksICpzdHIuZW5kKCkpOwogICAgLy8gbWVtY3B5KCBjaCwgKnN0ci5jX3N0cigpLCAxNiApOwogICAgc3RyaW5nIHRtcCA9ICpzdHI7CiAgICByZXZlcnNlKHRtcC5iZWdpbigpLCB0bXAuZW5kKCkpOwogICAgbWVtY3B5KCBjaCwgdG1wLmNfc3RyKCksIDE2ICk7CiAgICAKICAgICpzdHIgPSBzdGF0aWNfY2FzdDxzdHJpbmc+KGNoKTsKfQoKaW50IG1haW4odm9pZCkKewogICAgc3RyaW5nIHN0cigicG9wJ24gY2FuZHkhIik7CiAgICBjb3V0IDw8IHN0ciA8PCBlbmRsOwogICAgZnVuYyggJnN0ciApOwogICAgY291dCA8PCBzdHIgPDwgZW5kbDsKCiAgICByZXR1cm4gMDsKfQo=