What exactly is the point of having multiple source files in c++? Sorry if this incredibly simple.
In what context do you mean? Multiple headers in a project, or multiple headers included in the same file?
Breaking up code into different files when possible helps to make it much easier to maintain. Instead of having to search through 100,000 lines of code to fine one function definition, you might only have to look at 500. Plus it can speed up recompilation since you can just compile files that have been changed, then link against the previous object files.
For C++ headers in particular, it's generally a good idea to only have one class per header, so you'll have a bunch of different header files. Again, this is much more maintainable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With