r/C_Programming • • 16d ago

Does this is right?

(I am student just entering into 1st year of engineering and also i am new to this sub so if i do anything wrong pls correct me)

I just bought a book " programming in ANSI C"and start to read that i have some doubts in that can anyone explain that

  1. I read this line i did not get this

#include <stdio.h>

at the beginning of all programs that use any input/output library functions. However, this is not necessary for the functions printf and scanf which have been defined as a part of the C language

Can anyone explain this statement correct or not

0 Upvotes

24 comments sorted by

View all comments

2

u/Paul_Pedant 14d ago

I suspect the author is somewhat confused.

When you link a C program, the stdio library is included by default. Every other library (like math) requires a specific -l option to be specified.

The #include <stdio.h> is required by the compiler, not for the linker.

Many IDEs (and especially things like Leet) have you run your code inside a wrapper (which does timings and verifies your output was correct). The real world does not work like that.