Problems grasping .h files...

This is a discussion on Problems grasping .h files... within the C++ Programming forums, part of the General Programming Boards category; Decided to make a RPG Adventure game using Allegro and C++ and I want to split my files up. Here's ...

I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.

I think I get it now. We're setting things up in "classes" and that's why I'm getting weird errors with the constructors and deconstructurers.

I have one more question. What's the point of ifndef?

Thanks for the advice by the way! ;]

Glad it's clear, cause I was expecting to do a lot of explaining.

The include gaurds as they are called make it so that you can include the same header file more than once in the same translation unit. Header files can #include classes that the depend on, and source file can include all the headers that they depend on. This can cause the same file to be included twice. Include gaurds prevent this from being a problem.