471,850 Members | 861 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,850 software developers and data experts.

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?

Thanks.
Sep 1 '06 #1
1 6454
Banfa
9,065 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
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.