Different between class,header,source,template?

Can I know what is Different between class,header,source,template?
When we should use each type.
I try search but did not tells about that.
best regard.
Did some googling and found a few definitions.

Class

Classes are an expanded concept of data structures: like data structures, they can contain data members, but they can also contain functions as members.

http://www.cplusplus.com/doc/tutorial/classes/

Header

The '.h' file that contains all your declarations (usually)

Source

The '.cpp' (or c) file that contains the source (self explanatory).

Template

Templates are a feature of the C++ programming language that allows functions and classes to operate with generic types. This allows a function or class to work on many different data types without being rewritten for each one.

http://en.wikipedia.org/wiki/Template_%28C%2B%2B%29
Topic archived. No new replies allowed.