Is there such thing as implicit declaration in c++?

388 Views Asked by At

I was burnt just now. I hadn't enabled warnings while compiling my c code. I was using atof without including stdlib.h. So the atof was using implicit declaration which had default return type of int. So the code wasn't working. I was wondering if the concept of implicit declarations also applies to c++?

1

There are 1 best solutions below

0
Nicol Bolas On BEST ANSWER

C++ does not allow implicit function declarations. Indeed, even C99/11 doesn't allow them. GCC compiles C by default as C89, which is why you got the error you did.