Compilation of a header file in c++

  • Context: C/C++ 
  • Thread starter Thread starter krishna mohan
  • Start date Start date
  • Tags Tags
    C++ File
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 3K views
krishna mohan
Messages
114
Reaction score
0
Hi..am just learning c++...i have a doubt..

Suppose you have a header file and you include it in your main program by using the #include directive..then do you have to compile the header file separately? Or does it get compiled with the main program?
 
Physics news on Phys.org
I guess your yes means that one does not have to compile a header file separately...and it gets compiled with the main program..?
 
I understand..thank you..