Hey, just curious. Is atof() a C++ only function or will it work in standard C?

Recommended Answers

All 6 Replies

Have you checked a C reference? We're generally miffed when people ask questions that are easy to look up.

Have you checked a C reference? We're generally miffed when people ask questions that are easy to look up.

I've googled it, but I'm kind of confused. Could you point me to one of these C references? Thanks, sorry.

http://www.acm.uiuc.edu/webmonkeys/book/c_guide/index.html
http://www.cplusplus.com/reference/clibrary/


as you can see, atof() is part of the <stdlib.h>.

in C++ this library is called <cstdlib>


This is easily found with a minimum amount googling. its not that we dont want to help, but there's a sort of a minumum level of competence assumed that people can do basic things on their own.


.

http://www.acm.uiuc.edu/webmonkeys/book/c_guide/index.html
http://www.cplusplus.com/reference/clibrary/


as you can see, atof() is part of the <stdlib.h>.

in C++ this library is called <cstdlib>


This is easily found with a minimum amount googling. its not that we dont want to help, but there's a sort of a minumum level of competence assumed that people can do basic things on their own.


.

Thanks, I'll look harder next time, promise :)

Hey, just curious. Is atof() a C++ only function or will it work in standard C?

atof works with C standard too,jus include <stdlib.h> in your code

>Could you point me to one of these C references?
I'm a fan of Dinkumware's reference. It covers both C and C++, up to the latest standards.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.