Converting textbox->text to integer

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Could someone tell me how I go about converting textbox->text to and integer
value?

Thanks

Dave
 
Dave said:
Could someone tell me how I go about converting textbox->text to and integer
value?

Thanks

Dave
What type of C++ project are we talking about?
atoi() comes to mind.
 
The Int32::Parse() worked great. Thank you.

I tried the atoi() but got errors because the value passed from
textbox->text is System::String __gc * and atoi needs const char *.
Everything I tried gave me an error because of the String __gc * conversion.

Thanks again for the help.

Dave
 
Visual C++ .NET

Int32 i32Variable = Convert::ToInt32( textBox1->Text->Trim() );
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top