Structure program in C++ language

Examples of programs on the following material can be run with Borland C + + (Turbo C + + is fine). In general the structure of the program in C + + are as follows:
declaration header file / preprocessor
constant declaration
global var declaration
function declaration
class declaration
The main program (main function)
main () {
... ...
... ...
}

Description:
The declaration begins with the header file # include or # include "........." <.......> Filled dots with the name of the header file you wish to use. Header files is a function that supports the execution of certain instructions in C+ +

Declaration of constants
Declaration of global variables
Declaration of function can not be there. The function also can be placed seletah function main ().
Class declaration
The main function, must exist, beginning with {and end with}. In it contains instructions that will be executed following the declaration of variables (local variables) are needed.

Some header files that are often used:
iostream.h
For instructions:
<<"....................."; court cin>> nama_var;

conio.h
For instructions:
getch ();
clrscr ();

0 comments



Recent Entries