+ 1
Is it possible to create the c and c++ program without any header files
6 Answers
+ 5
Vlad Serbu although you didn't explicitly included stdio.h the C compiler added it for you, usually c compilers are able to resolve your call to stdio printf by adding the header and leaving a warning.
Anyway the answer is right, Yes.
+ 5
Good one Vlad Serbu !
I assumed it and I was wrong! Great lesson.
What I've found is that c is able to implicitly declare a function , then the compiler finds a match in the std and links it, but... is undefined behaviour since printf takes variable number of arguments.
That's why it gives warning to define printf or include stdio.h
+ 1
AZTECCO it's not that it adds the header for you, it's that it links against the standard library.
+ 1
AZTECCO Another clue is that macros (such as NULL) don't work.
0
short answer, Yes!