I have read some documents about each, for example
http://www.cplusplus.com/reference/string/stof/
http://www.cplusplus.com/reference/cstdlib/atof/
I undrstand that atof is part of <cstdlib> and has const char* as input parameter and std::stof is part of std::string and has different input format.
But not clea,
- can they be used interchangeably
- does they convert to same
floatvalue with same input - which is scenario best to use for each of these
Aucun commentaire:
Enregistrer un commentaire