Nat95 Nat95 - 1 year ago 119
C Question

what does #include <stdio.h> really do in a c program

I am a new student in c programming and I was coding some simple programs "Hello world" style.

In all of these programs I put

in the top but I am not sure what this means exactly. I googled it and I found that stdio.h is a file that has commands for the preprocessor, but what is preprocessor? I thought that when I write code, I compile it and my code transforms to a form that "computer" can read and then I can run it. Can somebody explain to me which is the usage of this command?

Answer Source

It looks for the stdio.h file and effectively copy-pastes it in the place of this #include statements. This file contains so-called function prototypes of functions such as printf(), scanf(), ... so that compiler knows what are their parameters and return values.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download