470,858 Members | 1,668 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

I cannot convert a textBox's text into a c-string

Hi. I Have started using Visual C++ 2008 a month ago. I Tried to make a GUI calculator but i cannot convert the textbox's text with the atof() function. The function cannot convert String^ type into a number. How can i convert from a String^ into c-string? Or how can i simple get the value of the textbox's text? By the way what kind of type String^ is? Please help me. Thanks. :-)
Jan 10 '08 #1
1 5044
9,208 Expert Mod 8TB
A String^ is a handle to a C++ object created on the garbage collected heap managed by the CLR.

Expand|Select|Wrap|Line Numbers
  1. String^ str = gcnew String("Hello");
You use the handle with the -> syntax for C++ pointers.

So, your immediate problem is just converting a String to a C string array of char.

Read up on interoperability here.
Jan 11 '08 #2

Post your reply

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

Similar topics

1 post views Thread by ericvdb | last post: by
reply views Thread by Mohammad Ali via DotNetMonster.com | last post: by
6 posts views Thread by Kevin O'Brien | last post: by
5 posts views Thread by BobLaughland | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.