You can use the standard library functions for conversions to/from strings/numbers to/from numbers/strings... Ok, here are a set of functions: from strings to numbers atof, atoi, _atoi64, atol.
These functions convert strings to integers or floats. Their name comes from: ansiitofloat, ansiitoint, ansiitoiint64bitslong, ansiitolong
For the reverse conversion u can use: itoa, fcvt (and its siblings, gcvt and ecvt)
Hope this helps. You can find the documentation for these functions on any compiler help, since they are ANSI (most of them, at least, i think).
This could be a good subject for a FAQ, actually since it is a preety common question in C.
[red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal... once stated: methane@personal.ro
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.