Trusted by millions of Kenyans
Study resources on Kenyaplex

Get ready-made curriculum aligned revision materials

Exam papers, notes, holiday assignments and topical questions – all aligned to the Kenyan curriculum.

Describe the structure of a C++ program.

Describe the structure of a C++ program.

Answers


Kavungya
A typical C++ program would contain four sections, which may be placed in separate code files and then compiled independently or jointly. The program sections are:
1. Include files
2. Class declaration
3. Member functions definitions
4. Main function program
A C++ program is commonly organized into three separate files by: placing the class declarations in a header file while the definitions of member functions go into another file. This approach enables the separation of the abstract specification of the interface (i.e. class definition) from the implementation details (i.e. member functions definition). 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

Kavungya answered the question on May 15, 2019 at 14:56

Answer Attachments

Exams With Marking Schemes

Related Questions