Thursday, July 9, 2009

What is the function of #include in C?

It lets the linker help the compiler piece together code that is in other files/libraries - for instance, if you do:





#include %26lt;iostream%26gt;





You're going to be able to use the functions within the iostream library - otherwise, it wouldn't know where to go to get those function definitions.

What is the function of #include in C?
when there are some functions ready in C compiler... no point writing them again. right? but how can you use those functions in your program. those functions are written in some files with extension '.h'. #include help u to add those function in your program and hence access all those functions of the particular file. for example... you write printf(....);. this printf function is placed in a file called stdio.h and so u write # include %26lt;stdio.h%26gt; to use such a function
Reply:in c langauge there many lines of code for many small function or code such as for getch(),or add or subtract.


so to avoid the long codes for such small function all the reserve words and grouped and a file is created.


so we just include such file and use those resrve words


No comments:

Post a Comment