Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how do i make a header file and use it in another program

+3 votes
asked Sep 2, 2020 by atulsangahvi (200 points)
Where my header.h file needs to be stored so that i can call it?

2 Answers

0 votes
answered Sep 5, 2020 by xDELLx (7,630 points)

For small programs, the best place is current directory ,ie same directory as the c file.

But this can be customised using compiler switches.Complier can be "informed" t olook for header files in certain paths where we want/have stored header files.Compiler switches give us the flexibilty to provide a host of paths , where the header files can be placed.

On GCC, -I (uppercase i) switch can be supplied when compiling your program.

gcc abc.c -I /home/mint

MS Visual Studio also provides the same flexiblity , you can explore this... I am rusty with MS tools.

0 votes
answered Sep 19, 2020 by akash singh yadav (180 points)
it stored in the library of programing file
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...