TUTORIALS: C++ PROGRAMMING LANGUAGE - Gossip Inn
TUTORIALS: C++ PROGRAMMING LANGUAGE

TUTORIALS: C++ PROGRAMMING LANGUAGE

Share This
C++ was developed by Bjarne Stroustrup in 1979 at Bell labs in Murray Hills, New Jersey as an enhancement to the C language named C with classes but later it was renamed C++ in 1983
It is regarded as an intermediate language.

PHASES IN C++ PROGRAMMING

There are six (6) phases in C++ programming language which are;

1. CREATING A PROGRAM

This involves editing a file with an editor program examples are note pad, 0s edit command, epilson, emacs and vim or vi.
The C++ is typed using an editor, The typed program is also known as source code. The source code is saved to a secondary storage such as your hard drive with file name extension .cpp, .cxx, .cc or .c.

2. PRE-PROCESSING THE PROGRAM

In this phase a command to compile the program is given. The pre-processor program
executes automatically before the compiler translation phase begins. The C++ pre-processor obeys commands called pre-processor directives which indicates that certain manipulations are to be performed on the program before compilation.
These manipulations usually include other text files to be compiled and performed various text replacement.

3. COMPILING THE PROGRAM

In this phase the compiler translates the C++ program into machine language code which is referred to as the object code.

4. LINKING THE PROGRAM

In the linking phase, a linker links the object code with the code for the missing functions to produce an executable program. 
C++ programs typically containing references to functions and data defined else where such as in the standard libraries or in the private libraries of group of programmers working on a particular project.

5. LOADING THE PROGRAM

Before a program can be executed, It must be first placed in the memory , This is done by the loader which takes the executable image from the disc and transfers it to the memory. Additional components from shared libraries that support the program are also loaded.

6. EXECUTING THE PROGRAM

The computer under the control of it's cpu (central processing unit) executes the program one instruction at a time. 

ESCAPE SEQUENCES/ESCAPE CHARACTERS

NEW LINE CHARACTER ( n);
Position cursor at the beginning of the next line.
HORIZONTAL TAB (\t);
Moves it to the tab space.
CARRIAGE RETURN (\r);
Position cursor at the beginning of current line.
BACK SLASH ( \ );
This is used to print back slash.
SINGLE QUOTES (\');
This is used to print single quotes.
DOUBLE QUOTES (\");
This is used to print double quotes.
SINGLE LINE COMMENT (//)

1 comment:

  1. Most of the time I don’t make comments on websites, but I'd like to say that this article really forced me to do so. Really nice post! mandarin language

    ReplyDelete

Pages