Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Features of OOPs
Emphasis is on data rather than procedures
A C++ program starts with function called main ( ). The body of the function is enclosed between curly braces. The program statements are written within the braces.
Each statement must end by a semicolon;
#include <iostream.h>
The line in the above program that start with # symbol are called directives and are instructions to the compiler. The word include with '#' tells the compiler to include the file iostream.h into the file of the above program.
File iostream.h is a header file needed for input/ output requirements of the program. Therefore, this file has been included at the top of the program.
void main ( )
main() is an entry point of a program
When program is loaded in the memory, the control is handed over to function main ( ) and it is the first function to be executed.
cout<<"Hello World!";
This statement prints our "Hello World!" message on the screen. cout understands that anything sent to it via the << operator should be printed on the screen.
C++ Identifiers
A C++ identifier is a name used to identify a variable, function, class, module, or any other user-defined item.
An identifier starts with a letter A to Z or a to z or an underscore (_) followed by zero or more letters, underscores, and digits (0 to 9).
C++ Keywords
The following list shows the reserved words in C++. These reserved words may not be used as constant or variable or any other identifier names.
void Main public break else If class export new while private protected this for Switch try