Created
August 20, 2014 11:32
-
-
Save kuba-orlik/cd84f9e5631230833d40 to your computer and use it in GitHub Desktop.
Returning dynamically generated array of char in c++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::string returning_string(){ | |
// | |
..code here | |
std::string result=... | |
// | |
int length = result.length(); | |
char* char_array = new char[length]; | |
strcpy_s(char_array, length+1, wrapped_bstr); | |
return char_array; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment