Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C/C++ question

Name: Anonymous 2010-04-19 12:47

So I'm just expanding into C++, previously I programmed only in Java. What I'm wondering about is how the separation of a program in source files and headers works in C. In Java every source file represents a class, but in C and C++ I understand that that is not necessarily the case.

I know (or, well, I think) header files are just a bunch of code that you #include as a sort of shorthand for copy-pasting it. But how do actual .c or .cpp source files work? How do the source files in a codebase all hook together?

Name: Anonymous 2010-04-19 13:18

>>3
Yes.
Lets say you work on a game. You would want to separate the engines because you may want to use it in another project. You could ofcourse copy/paste the functions into every Project, but If you want to update a certain function you'll have to scan through all the source files and update that function.

So instead have a library of functions somewhere which you access from different projects and can update with minimal fuss.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List