Overview of C++ Language: Fcpit Assignment No. - 1
Overview of C++ Language: Fcpit Assignment No. - 1
Overview of C++ Language: Fcpit Assignment No. - 1
– 1
Overview of C++ Language
The importance of C++ can well be judged from the following statement:
“Object – Oriented Technology is regarded as the ultimate
paradigm for the modeling of information, be that information data or
logic. The C++ has by now shown to fulfill this goal.”
EVOLUTION OF C++ LANGUAGE
SECTION 1: COMMENTS
SECTION 4:
Void main
{
local declarations
statements
}
SECTION 5:
OTHER
FUNCTIONS
AS REQUIRED
SECTION 1 is optional . It contains the description about the program.
SECTION 4 contains the main function. The execution of the program always begins
with the execution of the main function. The main function can call any number of
other functions, and those called function can further call other functions.
STRUCTURE CHARTS – A structure chart, also called hierarchy chart, show the
top-down design of a program. Each box in the chart indicates a task that the program
must accomplish.
return 0;
}
BUILDING THE PROGRAM
Once the design of the program is ready, the next step is to convert the program
design into a computer.
We key in computer memory using a text editor. A text editor helps us to enter the
character data into computer memory, allows editing the data in computer
memory, and save the data from memory in a disk file on secondary memory with
extension “.cpp”. This stored file is known as source file, and its contents are
known as source code.
COMPILING PROGRAM
The source code in the source file, stored on the disk, must to be translated into
machine language. This job is done by the compiler. The C++ compiler actually is a
combination of two separate programs – the preprocessor and the translator.
The preprocessor reads the source code and prepares it for translation.
The translator reads the translation unit instruction-by-instruction and checks them for
their grammatical accuracy. If there is a syntax error in it, it flags an error message –
called diagnostic message on the screen.
LINKING PROGRAM
Once the source code is translated into object code, though it is in machine
language, still it is not in executable form.
A linker is a development tool that extracts the referred library functions from the
system libraries, reads the object codes of the user-defined functions from the
object files and integrates them with the current object code to produce the final
executable code, which is stored in disk file with extension “*.exe”. This
executable code is the final form of the program that is ready for execution.
EXECUTING PROGRAMS
A logical error is a mistake that the programmer made while designing the
solution to the problem. The programmer must find and correct logical errors by
carefully examining the program output for a set of data for which results are
already known.
After testing the program development is almost complete . The structure charts,
algorithm, pseudo code, flow charts developed during the design phase become
documentation for others who are associated with the program . All of this
documentations needs to be saved and placed together for future reference.
DEPLOYING AND MAINTAINING THE PROGRAM
In the final phase, the program is deployed at the users site. Here also, the program
is kept under watch till the user gives green signals to it. Even after the
development project is complete, it needs to be maintained and evaluated regularly.
Programming Style
C++ is a free-format language, which
means that:
Extra blanks (spaces) or tabs before or after
identifiers/operators are ignored.
Blank lines are ignored by the compiler just
like comments.
Code can be indented in any way.
There can be more than one statement on a
single line.
A single statement can continue over several
lines.
Thank you for
watching!