I'm making an application in C++, using Windows Forms in Visual Studio 2008. I need to get a decimal number from a text box, but since it returns a string, I have to convert it to float.
After some research, I discovered the atof() function, plus several others.
However, when implemented, it produces an error, whose cause I do not understand.
For example, the following piece of code:
float f = atof ( textBox->Text );
Generates the following error:
Error 1 error C2664: 'atof' : cannot convert parameter 1 from 'System::String ^' to 'const char *'
It seems to try to get a const * char out of the string, then proceed to convert it to a float, but for some reason the conversion to const * char fails.