Exclamationhow do i convert a string to a float?

Posts 1–4 of 4 · Page 1 of 1
how do i convert a string to a float?
how do i convert a string to a float in c++?

and whats the difference between float and double?

thanks in advance.
Becouse no one else will help you:

float thefloat;
thefloat=atof(string);

atof - C++ Reference


___

A float is not precies. if you do 10.0f/3.0f*3.0f = 9.9999999999999f
But a float is smaller, so a double is bigger. (in memory usage)

Type double is a floating type that is larger than or equal to type float, but shorter than or equal to the size of type long double.
Thanks.

When editing memory for crossfire hacks, does it have to be a float value?
use either sprintf or atof
only offset appears with FSTP command are float (for example shotgun spread isnt float)
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us