0% found this document useful (0 votes)
40 views

Lesson1 C++

C++ is an object-oriented programming language that was created as an extension of C. It supports concepts like classes, inheritance and dynamic binding. C++ is commonly used to develop system software, drivers, applications and games. It differs from C in its support for object-oriented concepts and features like classes, inheritance and dynamic memory allocation. C++ programs are typically compiled to machine code using tools like compilers and linkers. Console programs that use text input/output are commonly used to learn C++ basics. Integrated development environments help compile and run simple C++ console programs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Lesson1 C++

C++ is an object-oriented programming language that was created as an extension of C. It supports concepts like classes, inheritance and dynamic binding. C++ is commonly used to develop system software, drivers, applications and games. It differs from C in its support for object-oriented concepts and features like classes, inheritance and dynamic memory allocation. C++ programs are typically compiled to machine code using tools like compilers and linkers. Console programs that use text input/output are commonly used to learn C++ basics. Integrated development environments help compile and run simple C++ console programs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

C++ PROGRAMMING

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

Global Declaration Section

Class Declaration and Method Definition Section

Main Function

Method Definition Section

9
SIMPLE PROGRAM C++
#include<iostream.h>/*Header File*/
int main()/*Main Function*/
{
cout<<"\n*HELLO*\n";
/*Output Statements*/
}

10
C++ DATA TYPES

Primary Data Type int, float, char, void

User Defined Data structure, union, class, enumeration


type

Derived Data Type array, function, pointer, reference

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.

• A single instruction to a computer could look like this:

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.

• Console programs are easy to interact with, and generally have a


predictable behavior that is identical across all platforms. They are
also simple to implement and thus are very useful to learn the
basics of a programming language: The examples in these tutorials
are all console programs.

• The easiest way for beginners to compile C++ programs is by


using an Integrated Development Environment (IDE). An IDE
generally integrates several development tools, including a text
editor and tools to compile programs directly from it.

14
IDE PLATFORM CONSOLE PROGRAMS

CODE::BLOCKS Windows/ Compile console


Linux/MacOS programs using
Code::blocks
Visual Studio Express Windows Compile console
programs using VS
Express 2013
Dev-C++ Windows Compile console
programs using Dev-C++

15
Thank you! 16

You might also like