[go: up one dir, main page]

0% found this document useful (0 votes)
26 views12 pages

Chapter 1

C++ is a versatile, middle-level programming language that supports various programming paradigms and was developed by Bjarne Stroustrup in 1979. It is widely used in multiple application domains, including system software and user interfaces, and emphasizes the importance of understanding programming concepts. The document also discusses the role of text editors and compilers in programming, as well as the distinctions between low-level and high-level programming languages.

Uploaded by

sabastansabaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views12 pages

Chapter 1

C++ is a versatile, middle-level programming language that supports various programming paradigms and was developed by Bjarne Stroustrup in 1979. It is widely used in multiple application domains, including system software and user interfaces, and emphasizes the importance of understanding programming concepts. The document also discusses the role of text editors and compilers in programming, as well as the distinctions between low-level and high-level programming languages.

Uploaded by

sabastansabaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Chapter 1

Introduction to C++
• 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.
• C++ was developed by Bjarne Stroustrup starting in 1979
at Bell Labs in Murray Hill, New Jersey, as an
enhancement to the C language and originally named C
with Classes but later it was renamed C++ in 1983.
Learning C++
• The most important thing while learning C++ is to focus
on concepts.
• The purpose of learning a programming language is
to become a better programmer; that is, to become
more effective at designing and implementing new
systems and at maintaining old ones.
• C++ supports a variety of programming styles. You can
write in the style of Fortran, C, Smalltalk, etc., in any
language. Each style can achieve its aims effectively
while maintaining runtime and space efficiency.
Use of C++

• C++ is used by hundreds of thousands of programmers in


essentially every application domain.
• C++ is being highly used to write device drivers and other
software that rely on direct manipulation of hardware
under real-time constraints.
• C++ is widely used for teaching and research because it
is clean enough for successful teaching of basic concepts.
• Anyone who has used either an Apple Macintosh or a PC
running Windows has indirectly used C++ because the
primary user interfaces of these systems are written in
C++.
Text Editor
• This will be used to type your program. Examples of
few editors include Windows Notepad, OS Edit
command, Brief, Epsilon, EMACS, and vim or vi.
• Name and version of text editor can vary on
different operating systems. For example, Notepad
will be used on Windows and vim or vi can be
used on windows as well as Linux, or UNIX.
• The files you create with your editor are called
source files and for C++ they typically are named
with the extension .cpp, .cp, or .c.
C++ Compiler
• This is an actual C++ compiler, which will be used to
compile your source code into final executable
program.
• Most C++ compilers don't care what extension you
give to your source code, but if you don't specify
otherwise, many will use .cpp by default.
• Most frequently used and free available compiler
is GNU C/C++ compiler, otherwise you can have
compilers either from HP or Solaris if you have
the respective Operating Systems.
Introduction to programming
• A Computer is an electronic device that accepts
data, performs computations, and makes logical
decisions according to instructions that have been
given to it; then produces meaningful information
in a form that is useful to the user.
• Computer programming (often shortened to
programming or coding) is the process of writing,
testing, debugging/troubleshooting, and
maintaining the source code of computer
programs.
Cont…
• Writing computer programs means writing instructions, that will
make the computer follow and run a program based on those
instructions. Each instruction is relatively simple, yet because of
the computer's speed, it is able to run millions of instructions in
a second. A computer program usually consists of two elements:
– Data – characteristics
– Code – action
• Computer programs (also know as source code) is often written
by professionals known as Computer Programmers (simply
programmers). Source code is written in one of programming
languages. A programming language is an artificial language that
can be used to control the behavior of a machine, particularly a
computer.
Cont…
• Programming languages, like natural language (such as Amharic),
are defined by syntactic and semantic rules which describe their
structure and meaning respectively. The syntax of a language
describes the possible combinations of symbols that form a
syntactically correct program. The meaning given to a combination
of symbols is handled by semantics. Many programming
languages have some form of written specification of their syntax
and semantics; some are defined only by an official
implementation.
• In general, programming languages allow humans to
communicate instructions to machines.
• A main purpose of programming languages is to provide
instructions to a computer.
Cont…
• Programming languages can be divided in to two major categories: low-level and
high-level languages
 Low-level languages
Computers only understand one language and that is binary language or the language
of 1s and 0s. Binary language is also known as machine language, one of low-level
languages.
• Assembly language correspondences symbolic instructions and executable
machine codes and was created to use letters (called mnemonics) to each machine
language instructions to make it easier to remember or write. For example:
ADD A, B – adds two numbers in memory location A and B
• Assembly language is nothing more than a symbolic representation of machine
code, which allows symbolic designation of memory locations.
• The assembly language must be translated to machine code by a separate program
called assembler. The machine instruction created by the assembler from the
original program (source code) is called object code.
Cont…
• High-level languages
 High-level languages are more English-like and, therefore, make
it easier for programmers to "think" in the programming
language.
 High-level languages also require translation to machine
language before execution. This translation is accomplished by
either a compiler or an interpreter. Compilers translate the entire
source code program before execution. Interpreters translate
source code programs one line at a time. Interpreters are more
interactive than compilers. FORTRAN (FORmula TRANslator),
BASIC (Bingers All Purpose Symbolic Instruction Code), PASCAL,
C, C++, Java are some examples of high-level languages.
Cont…
 Procedural Programming Languages
• Procedural programming specifies a list of operations that the
program must complete to reach the desired state. Each
program has a starting state, a list of operations to complete,
and an ending point. This approach is also known as
imperative programming. Integral to the idea of procedural
programming is the concept of a procedure call.
• Procedures, also known as functions, subroutines, or
methods, are small sections of code that perform a particular
function.
• Two of the most popular procedural programming languages
are FORTRAN and BASIC.
Cont…
• Object-Oriented Programming Languages
 Object-oriented programming is one the newest and
most powerful paradigms. In object- oriented
programs, the designer specifies both the data
structures and the types of operations that can be
applied to those data structures.
 A program thus becomes a collection of cooperating
objects, rather than a list of instructions. Objects can
store state information and interact with other objects,
but generally each object has a distinct, limited role.

You might also like