Skip to content

Instantly share code, notes, and snippets.

@kuba-orlik
Created August 20, 2014 11:32
Show Gist options
  • Select an option

  • Save kuba-orlik/cd84f9e5631230833d40 to your computer and use it in GitHub Desktop.

Select an option

Save kuba-orlik/cd84f9e5631230833d40 to your computer and use it in GitHub Desktop.

Revisions

  1. kuba-orlik created this gist Aug 20, 2014.
    10 changes: 10 additions & 0 deletions Return char*
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    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;
    }