Lesson1 C++
Lesson1 C++
ME-52
1
HISTORY
• C++ is a multi-paradigm programming
language that supports object oriented
programming (OOP) created by Bjarne
Stroustrup in 1983 at Bell labs, C++ is an
extension of C programming and the
programs written in C language can run in
C++ compiler.
• The development of C++ actually began four “C makes it easy to
years before its release, in 1979. It did not shoot yourself in the
foot; C++ makes it
start with the name C++. Its first name was C harder, but when you
with classes. do, it blows your whole
leg off.” 2
HISTORY
• In the late part of 1983, C with classes was first used for AT&T’s
internal programming needs. Its name was changed to C++ later in
the same year.
• It is of course also used in a wide range of other application
domains, notable graphics programming. C++ supports inheritance
through class derivation. Dynamic binding is provided by Virtual
class function.
3
USES OF C++ LANGUAGE
• C++ is used by programmers to develop computer
software
• It is used to create general system software
• Used to build drivers for various computer devices
• Software for servers and software for specific
applications
• Used in the creation of video games.
4
DIFFERENCE
BETWEEN C AND C++
C C++
C is procedural Language C++ is non-Procedural i.e. Object oriented
Language.
Top Down approach is used in Program Bottom up approach adopted in Program
Design Design.
Multiple Declaration of global variables Multiple Declaration of global variables
are allowed. are not allowed.
C requires all the variables to be defined C++ allows the declaration of variable
at the starting of a scope. anywhere in the scope i.e. at time of its
First use.
C requires all the variables to be defined In C++, new and delete operators are used
at the starting of a scope. for Memory Allocating and Deallocating. 5
ADVANTAGE OF C++
• C++ is relatively-low level and is a systems
programming language.
• It has a large community.
• It has a relatively clear and mature standard.
• Modularity’
• Reusability and readability
6
DISADVANTAGE OF C++
• Data is global or local.
• It emphasis on instructions bur not on data.
• It can be generally heavy if not careful.
• Data is global and global data does not have security.
7
STANDARD LIBRARIES
• The C++ Standard Library can be categories into two
parts:
❖ The standard function library: This library consists of
general-purpose, stand-alone function that are not part
of any class. The function library is inherited from C.
❖ The object oriented class library: This is a collection of
classes and associated function.
▪ Standard C++ library incorporates all the standard C
libraries also, with small additions and changes to
support type safety.
8
STRUCTURE OF C++
Header File Declaration
Main Function
9
SIMPLE PROGRAM C++
#include<iostream.h>/*Header File*/
int main()/*Main Function*/
{
cout<<"\n*HELLO*\n";
/*Output Statements*/
}
10
C++ DATA TYPES
11
Compilers
• Computers understand only one language and that language
consists of sets of instructions made of ones and zeros. This
computer language is appropriately called machine language.
12
Compiler
• C++ is designed to be a compiled
language, meaning that it is generally
translated into machine language that can
be understood directly by the system,
making the generated program highly
efficient. For that, a set of tools are
needed, known as the development
toolchain, whose core are a compiler and
its linker.
13
Console Programs
• Console programs are programs that use text to communicate with
the user and the environment, such as printing text to the screen or
reading input from a keyboard.
14
IDE PLATFORM CONSOLE PROGRAMS
15
Thank you! 16