Sunday, April 12, 2009

Structure of C++ Porgram



Structure of C++ Program

A typical C++ program would contain four sections as shown in fig. These sections may be placed in separate code files and then compiled independently or jointly.
It is common practice to organize a program into three separate files. The class declarations are placed in a header file and the definitions of member functions go into another file. Finally, the main program that uses the class is placed in a third file which “includes” the previous two files as well any other files required.

Syntax for structures of C++ Program

// Comment Statements
header files
cass declaration
{
dta member;
member function();
};
void main()
{
cass name object name;
oject name. member function();
getch();
}

No comments:

Post a Comment