Why do you need to make your own include files and what do you put in them?
Thanks
-Chris
Why do you need to make your own include files and what do you put in them?
Thanks
-Chris
>>> Why do you need to make your own include files
You don't need to make your own include files at all. It is perfectly possible to create very large programs without. It is simply that most people, and almost all professionals do not choose to do it that way.
As your programmes get more complicated, (and larger), you will find you want to break your program up into several smaller files, not least for the fact that it compiles faster. If you change one line in a 100000 line program file, it will compile 100000 lines. If you've broken that up into 1000 line files, only one gets done. This is one reason for custom includes. Rather than re- prototyping and extern'ing your variables in each of your smaller files, your create an include with this stuff in it and #include it.
Once you get a bit more sophisticated, you'll want to start creating libraries and .DLL's. For the same reason, you'll create custom includes for each.
As with everything, there are other reasons as well, but think about these for now.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
As I understand it, you write all your functions (and the function's code) into header files, then include those header files into the source file which has the main() function (then the code in the main function). Is this all correct...?