What is file inclusion directive or #include directive ?

#include <>

or

#include “file name.h”
This directive treats has included in the current file i.e in current file also contain data of the file which has included by #include directive.

e.g
first create a file of file name
cube.h which contain :


int cube ( int a)
{
Int b;
B=(a)*(a)*(a);
Return b;
}


Now create any another c file let math.c which contain :

#include “cube.h”
void main()
{
int p=5,q;
q=cube(p);
printf(“%d”,q);
}

No comments:

Post a Comment