0

Sorry for the newbie question, but what are header files? What should they contain? Just classes and definitions?

3
Contributors
3
Replies
5
Views
6 Years
Discussion Span
Last Post by Dark Byte
0

If possible, header should contain a skeleton for the desired Object.
For example a header might contain a class skeleton named Car, and you might define
the actual implementation of Car in a different .cpp file. Another example, you
might declare some functions in a header, but do the actual implementation in a different .cpp file.

//BestClassInUniverse.h
// this header defines the skeleton for the BestClassInUniverse
class BestClassInUniverse{
public:
  void doTheBestThingInUniverse(); //skeleton
};
//BestClassInUniverse.cpp
//actually defines the implementations
BestClassInUniverse::doTheBestThingInUniverse(){
  //some  top secret code.
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.