Ad Code

Responsive Advertisement

#include in C language.


Here we are going to learn about #include. when we include any file (header files) then we use  #include 


#include<file.h> : means user include the header file and other file into the program.

Explain of #include <file.h>


in simply you just know about

#include

<file.h>

# :-> pre-processor
include:-> include any file into program
<file.h>:->means it is the file that contain the program

it is the full meaning of the #include<file. h>

but, in our website you can also find out the full explanation of #include<file.h>.


1)# :-> means it is the pre-processor that means ,when the program will executed than the compiler first compile this code and than the other code will be executed.so the # sign is used to pre compiler into the program



programmer can also compile other code and used other type
ex :-. #define,#include<file.h> all the example of the #(pre-processor)
that means the compiler first compile this code.





  1. include :-> it is the main of the c program, in simply you  only know about that include is used to include any file but the include meaning we don't knin this example we show you about the include




when the programmer used include any file or headwer file into the program than the include is used and the include is the directory that means all the header file are access by the include folder and all the header
file are stored in the include directory. When the programmer used the header file than the file are retrive in the include folder.



The include folde are save into the urs( for ubuntu) and tc(for window) are stored the include directory.

Is the above example that you can easy to understood

so the header file and other file are access by the inclue directory.




  1. <file.h> :-> means it contain the header file and other file.
The heade files are contain the source code of the function that used into the program 
ex,  if the user prin any text into the consol than they used the printf();.
But the computer don't know what is the printf so, the user used the stdio header file that means, where #Include<stdio.h> are execut that the complier read the stdio header file and than it understood the printf so, the header file contain the machine source code that the machine easy to understood the functio that used into the program .


Type of include the header file :-> there are the three type that the users can include the header file

1)< file.h>
2)”file.h”

1)<file.h>:-> it is the globally means when the user include any header file than the header file are directly acess into the include directory.



2)”file.h” :-> it is not a globally for example the user curently worked on a c\a\a.c so the user location a directory if user used “file.h” than the header file are stored into the current folder maens a/file.h

if user have two folder A and B into the c directory and user are currently work into the b folder and he used the file.h 





than the compiler get error that the file.h is not avilable into the b directory so, if the user used any file.h than the file are must be stored into the current folder(directory).


Ex: of <file.h>
#include<stdio.h>
void main()
{
           printf(“hello”);
}

in this example the stdio.h are stored into the include directory. So it is directly acess.

Ex: of “file.h”

#include"stdio.h"
void main()
{
          printf(“hello”);
}
in this example the user curently worked in the A directory means the program are be saved into the A folder so, the stdio.h must be stored into the A folder.
Means: a/a.c and a/stdio.h


If you like this article then comment to us. thank you

you can also learn about main() function in our next lesson.

https://drive.google.com/file/d/1vEklSXU5LRsDoJYCKtAVqotV2AX6C1Gp/view?usp=drivesdk

  1. ❮ Previous                                                      Next ❯

Post a Comment

4 Comments

  1. https://github.com/cs50/ide

    ReplyDelete
  2. https://apidoc.c9.io/c9v3/#!/api/commands

    ReplyDelete
  3. import java.io.IOException;

    class CLS extends Thread {

    public static void main(String[] arg) throws IOException, InterruptedException {
    for(int j=1; j<4; j++){
    for(int i=0;i<20;i++)
    { try{
    System.out.print(i);
    sleep(100);
    new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor();
    System.out.print(j+" ");
    }
    catch(Exception ex){}

    }
    }
    }
    }

    ReplyDelete
  4. https://drive.google.com/file/d/1MB6xsfkE-jDynWvJ4YiqAdI8BV6jiFd4/view?usp=drivesdk vb

    ReplyDelete