Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
AnsiString to char*
AnsiString s1{"abcdefgh"};
std::unique_ptr<char> c1{new char[s1.Length()+1]};
char* c2 = c1.get();
memcpy(c1.get(), s1.c_str(),s1.Length());//メモリブロックコピー
std::string s2;
for (int i=0; i < s1.Length(); i++)
s2 = s2 + *c2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment