explain structure of c++ program

Structure of c++ program : a typical c++ program would contain four sections and the sections may be placed in separate code file and then compiled independently or jointly they are:

  • Include files
  • Class declaration
  • Member functions definitions
  • Main function program

it is common practice to organise a program into three separate files. The class declaration are placed in a header file and the definitions of member functions go into another file. This approach enable the programmer to separate the abstract. Finally, the main program that uses the class is placed in a third file which "includes" the previous two files as well as any other files required.

this approach is based on the concept of client server model the class definition including the member functions institute the server that provides services to the main program known as client. The client uses the server through the public interface of the class.