My question is how files are linked in C++, specifically in MS Visual Studio 2008 since that's what I'm using (but would be very interested to know if there are significant differences between compilers in this regard).

When you generate a new solution in MSVS you also get 3 folders delivered: Header Files, Resource Files (which I haven't used yet but would be also interested to know what it's used for), and Source Files. One part of the intention is pretty obvious: Put your .h files in header files and your .cpp files in source files.

Just doing that and writing correct code will compile and run as console application IF, when you created the project in the brief wizard, you clicked "create empty project." However, if you get in a rush (as I just did, hence reminding me of this question, which I've had for a while) and just click "finish" before specifying that you want an empty project, then MS creates several generic files for you (can't remember exactly what since I deleted them all and have no desire to repeat this mistake).

I kind of think these files are for a visual C++ project, but that's really peripheral to my main question: After deleting these files from the solution folder and just creating some new ones initially that I knew would work (I just copied some working files that I was intending to change), Visual Studio refused to compile the program and explicitly asked for the files that I had just deleted.

At the same time, on the surface, everything looked just as it had in the functioning version (except that the name of the solution folder was different). So, what I'm wondering is what the compiler, or specifically the one used in Visual Studio, uses for linking and compiling the files that goes above and beyond simply their location in the appropriate folders. So, basically, the things I would need to change if I clicked the wrong button and got some precompiled files I didn't want.