We help IT Professionals succeed at work.

How to convert string to char[] in C++ 2008

xuanspider
xuanspider asked
on
1,281 Views
Last Modified: 2012-05-06
I have a array char c[256]

How to convert txtbox1->Text to c[]?

Thank you. The environment is c++2008
Comment
Watch Question

Commented:
char* pText = Marshal::StringToHGlobalAnsi( txtbox1->Text );
strcpy( c, pText );
Marshal::FreeHGlobal( pText );

Author

Commented:
IntPtr can not convert to char *, my environment is .net 2008
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
I'm sorry that still cannot, same error. Please note that the environment is C# express 2008

Author

Commented:
Anyhow, thanks.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.