Link to home
Start Free TrialLog in
Avatar of vaithilingam R
vaithilingam R

asked on

conversion

how to convert from std::wstring to wchar_t*
SOLUTION
Avatar of Zoppo
Zoppo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@Sara: Thanks for correcting me, of course you're right, I didn't read the question carefully :o)

The 'strdup' was just the first idea I had for a sample to show use of 'c_str()', it was not my intention to suggest using this to get a none-const pointer - and I just had luck 'strdup' expects a const pointer and returns a none-const pointer, so the code at least should compile ;o)

Best regards,

ZOPPO
I just had luck 'strdup' expects a const pointer
you shouldn't say luck. i am pretty sure it is experience that you posted working and compilable code.

Sara
LOL, thanks Sara, what a compliment, this really made my day better :o))
2 valid solutions where the accepted solution doesn't require to free buffers after use.

Sara