A Lesson1-Overview-of-C-Language

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

UNIT 2

C++ Basics

IT 103 Computer Programming 1


Lesson 1
Overview of C++ Language

IT 103 Computer Programming 1


UNIT 2
LESSON 1 Overview of C++ Language
C++ is a statically typed, compiled, general-purpose, case-
sensitive, free-form programming language that supports
procedural, object-oriented, and generic programming.

C++ is regarded as a middle-level language, as it comprises a


combination of both high-level and low-level language features.

Note:
A language is a set of valid sentences. What makes a sentence
valid? You can break validity down into two things: syntax and
semantics. The term syntax refers to grammatical structure
whereas the term semantics refers to the meaning of the
vocabulary symbols arranged with that structure.

IT 103 Computer Programming 1


UNIT 2
LESSON 1 Overview of C++ Language
Processing a C++ Program
1 Writing and Editing a Program Editor

2 Processing preprocessor or directives


Preprocessor
Syntax Error

3 Compiling a C++ Program Compiler


Library
4 Linking a C++ Program
Linker

5 Loading a Program into Memory


Loader

6 Executing a Program Execution


IT 103 Computer Programming 1
UNIT 2
LESSON 1 Overview of C++ Language
Processing a C++ Program
1 Writing and Editing a Program
You use a text editor to create a C++ program following the
rules or syntax of the high-level language. This program is
called the source code, or source program. The program
must be saved in a text file that has the extension .cpp.
An integrated development environment (IDE) is a
programming environment that has been packaged as an
application program, typically consisting of a code editor, a
compiler, a debugger, and a graphical user interface (GUI)
builder. The IDE may be a standalone application or may be
included as part of one or more existing and compatible
applications.
IT 103 Computer Programming 1
UNIT 2
LESSON 1 Overview of C++ Language
Processing a C++ Program

2 Processing preprocessor or directives


C++ statements are processed by a program called
preprocessor.

IT 103 Computer Programming 1


UNIT 2
LESSON 1 Overview of C++ Language
Processing a C++ Program

3 Compiling a C++ Program


. After processing preprocessor directives, the next step
is to verify that the program obeys the rule of the
programming language – that is, the program is
syntactically correct – and translate the program into the
equivalent machine language. The compiler checks
source program for syntax errors and, if no error is
found, translates the program into the equivalent
machine program. The equivalent machine language
program is called an object program.

IT 103 Computer Programming 1


UNIT 2
LESSON 1 Overview of C++ Language
Processing a C++ Program
4 Linking a C++ Program

Once the program is developed and successfully


compiled, you must still bring the code for the resources
used from IDE into your program to produce a final
program that the computer can execute. This prewritten
code(program) resides in a place called the library. A
program called a linker combines the object program
with the programs from libraries.
Linker is a program that combines the object program
with other programs in the library and is used in the
program to create the executable code.

IT 103 Computer Programming 1


UNIT 2
LESSON 1 Overview of C++ Language
Processing a C++ Program

5 Loading a Program into Memory


You must next load the executable program into main
memory for execution. A program called a loader
accomplishes this task.
Loader is a program that loads an executable program
into main memory.

IT 103 Computer Programming 1

You might also like