Header vs source file | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Header vs source file

What is the difference between a header file and a source file, and what are they used for?

25th May 2017, 12:09 PM
Catherine Jones
2 Answers
+ 3
Headers are usually for declaring classes or functions in a namespace. Source files are for implementing and defining what you decalred in a header. This speeds up compilation times drastically, especially if you forward declare stuff in headers.
25th May 2017, 12:26 PM
aklex
aklex - avatar