Source & Header file in C++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Source & Header file in C++

can you please provide me an example of the source and header file in c++ (with some details) ? so that I can understand it properly.

18th Aug 2020, 6:21 PM
Shubhankar Mishra
Shubhankar Mishra - avatar
1 Answer
+ 2
The basic idea is that there is the interface (header file) which contains all of the methods and class declarations, the implementation file contains all of the definitions of the methods, and the source file contains the application of the class and methods. The purpose is that you can reuse the interface and implementation files as they are with any application file. Below are some examples. The first contains five files (2 interfaces, 2 implementations, 1 source) and the second and third contain 1 interface, 1 implementation, and 1 source. If you like them, give them a like. https://code.sololearn.com/cp9GtXD6JamP/#cpp https://code.sololearn.com/c1KHFBUD4K3r/#cpp https://code.sololearn.com/c6exQ5LVO4ds/#cpp
19th Aug 2020, 12:05 AM
Edward Finkelstein
Edward Finkelstein - avatar