468,512 Members | 1,375 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

What WCHAR * to wstring does internally?

I have a WCHAR array (say WCHAR *wszName). I want to convert it to wstring. So, I do the following:-

wstring wstrName(wszName);

It works. But I want to know what internally happens when the conversion takes place. For example, does it allocate some new buffer? While debugging an application, I looked into the code of the conversion, but could not understand it. Could you please post the code of conversion and explain it to me?

Sep 1 '06 #1
1 5952
9,056 Expert Mod 8TB
Yes I think in most inplementations it would allocate a buffer.

There would be no point me posting the code I might have because the code is platform dependent and my not be working in the same way the code on your platform is working. Why don't you post the code from your platform and we will try to explain it.
Sep 1 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

12 posts views Thread by Flzw | last post: by
1 post views Thread by Saurabh Aggrawal | last post: by
3 posts views Thread by Lars Nielsen | last post: by
8 posts views Thread by Divick | last post: by
18 posts views Thread by Manjunath.M | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.