Elmi Elmi - 3 years ago 219
C Question

atof() for float instead of double

returns a double, which results in a warning when I assign it to a float-value (and yes, I definitively have to use float).

So my question: is there a
-variant available which returns a plain float? Or do I have to solve this by a cast - which would be a pity because it wastes resources for creating a double which will be thrown away immediately.

Answer Source

Use strtof instead, it will return a float.

See documentation here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download