+ 1
Someone explain it... Plz!!!
I'm a bit confused about something in C. I noticed that if I forget to #include <stdio.h>, my code with printf still compiles and runs. I just get a warning. How does that actually work? I thought it always needed the header file. Why isn't it a hard error, and how does the program figure out where the real printf function is? https://sololearn.com/compiler-playground/cr6kUJGXqt8x/?ref=app
3 Respuestas
+ 3
Ferdous 👾 I believe the compiler is running in C89/C90 compatibility mode by default and the compiler is part of the GNU Compiler Collection (GCC), which historically allowed this as a warning for common cases like printf even in newer modes, though it's discouraged.
+ 2
No ...
Calling a variadic function without a prototype (relying on implicit declaration) however may cause undefined behavior.
So in C89/C90, are functions like printf or scanf implicit functions?
No - not implicit but default
+ 1
BroFar So in C89/C90, are functions like printf or scanf implicit functions?



