Jump to content
  • Advertisement
Sign in to follow this  
mgattala

problem with wcslen String ^ to char *

This topic is 3074 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all , I have some peice of code which is working fine and an analogous code in the same fine returning errors.. working code : pin_ptr<const wchar_t> file_x= PtrToStringChars(path); char * file = new char(wcslen(file_x)+1); int t= 0 ; while(file_x[t]!= '\0') { file[t] = (char)file_x[t]; ++t; } failing code : String^ valuefromc_seed ; valuefromc_seed = gcnew String(Y); (y is defined in a dll using c file) pin_ptr<const wchar_t> seed_x= PtrToStringChars(valuefromc_seed); char * seed = new char(wcslen(seed_x)); int u= 0 ; while(seed_x!= 'm') { seed = (char)seed_x; ++u; } Its precisely failing at char * seed = new char(wcslen(seed_x)); .. it says head corruption... anyone has any input on this ? I need to use wcslen cos , i am using express edition 2008 ...with no marhsalling package.. thanks

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!