Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualParadigm Shifter

Posted 18 March 2013 - 12:55 PM

You are returning a pointer to owned by an object that lives on the stack... so it goes out of scope and is destroyed.

 

Either return a wstring directly (or through a reference/pointer), or (not recommended) have the caller supply a buffer which you fill (and opens up potential for buffer overwrites, etc.).


#1Paradigm Shifter

Posted 18 March 2013 - 12:47 PM

You are returning a pointer to an object that lives on the stack... so it goes out of scope and is destroyed.

 

Either return a wstring directly (or through a reference/pointer), or (not recommended) have the caller supply a buffer which you fill (and opens up potential for buffer overwrites, etc.).


PARTNERS