I'm programming on a AVR XMEGA microcontroller, using AtmelStudio.
I'm having trouble converting a string to a float. The string is called token2
and has the value "8.604165"
I've already tried a couple of functions:
float lon = atof(token2); printf("lon=%f", lon);
returnslon=?
float lon = strtod(token2, NULL); printf("lon=%f", lon);
returnslon=?
float lon = strtof(token2, NULL); printf("lon=%f", lon);
gives an errorundefined reference to strtof
, even including<stdlib.h>
Am I doing something wrong?