Introduction to C++
Difference between C and C++
Evolution of C++
Procedure Oriented Programming vs Object OrientedProgramming
Key concepts of Object-Oriented Programming
Advantages and Disadvantages of OOP
Templates
Generic Programming with Templates
Need for Templates
Definition of class Templates
Normal Function Templates
Over Loading of Template Function
Bubble Sort Using Function Templates
Difference Between Templates and Macros
Linked Lists with Templates
Exception Handling
Principles of Exception Handling
The Keywords try throw and catch
Multiple Catch Statements
Specifying Exceptions
Classes and Objects
Classes in C++
Declaring Objects
Access Specifiers and their Scope
Defining Member Function
Overloading Member Function
Nested class
Constructors and Destructors
Introduction
Characteristics of Constructor and Destructor
Application with Constructor
Constructor with Arguments (parameterized Constructors)
Destructors
Operator Overloading
The keyword Operator
Overloading Unary Operator
Operator Return Type
Overloading Assignment Operator (=)
Rules for Overloading Operators
Inheritance
Reusability
Types of Inheritance
Virtual Base Classes
Object as a Class Member
Abstract Classes
Advantages of Inheritance
Disadvantages of Inheritance
Pointer
Features of Pointers
Pointer Declaration
Pointer to Class
Pointer Object
The this Pointer
Pointer to Derived Classes and Base Class
Binding Polymorphisms and Virtual Functions
Introduction
Binding in C++
Virtual Functions
Rules for Virtual Function
Virtual Destructor
Templates
Generic Programming with Templates
Need for Templates
Definition of class Templates
Normal Function Templates
Over Loading of Template Function
Bubble Sort Using Function Templates
Difference Between Templates and Macros
Linked Lists with Templates
Exception Handling
Principles of Exception Handling
The Keywords try throw and catch
Multiple Catch Statements
Specifying Exceptions
Classes and Objects
Classes in C++
Declaring Objects
Access Specifiers and their Scope
Defining Member Function
Overloading Member Function
Nested class
Constructors and Destructors
Introduction
Characteristics of Constructor and Destructor
Application with Constructor
Constructor with Arguments (parameterized Constructors)
Destructors
Operator Overloading
The keyword Operator
Overloading Unary Operator
Operator Return Type
Overloading Assignment Operator (=)
Rules for Overloading Operators
Inheritance
Reusability
Types of Inheritance
Virtual Base Classes
Object as a Class Member
Abstract Classes
Advantages of Inheritance
Disadvantages of Inheritance
Pointer
Features of Pointers
Pointer Declaration
Pointer to Class
Pointer Object
The this Pointer
Pointer to Derived Classes and Base Class
Binding Polymorphisms and Virtual Functions
Introduction
Binding in C++
Virtual Functions
Rules for Virtual Function
Virtual Destructor
Download this Presentation for free from www.ecti.co.in/downloads.html
No SIGN UP REQUIRED.
C++ Programming Training PPTs / PDFs for free.
Download free C++ Programming study material. Learn C++ Programming for free in 2 hours.
Download this Presentation for free from www.ecti.co.in/downloads.html
No SIGN UP REQUIRED.
C++ Programming Training PPTs / PDFs for free.
Download free C++ Programming study material. Learn C++ Programming for free in 2 hours.
Object oriented programming 7 first steps in oop using c++Vaibhav Khanna
Advantages of C++
Portability. C++ offers the feature of portability or platform independence which allows the user to run the same program on different operating systems or interfaces at ease. ...
Object-oriented. ...
Multi-paradigm. ...
Low-level Manipulation. ...
Memory Management. ...
Large Community Support. ...
Compatibility with C. ...
Scalability.
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTREjatin batra
Are you in search of C & C++ Training in Ambala? Now your search ends here.. BATRA COMPUTER CENTRE provides best training in:Basics of Computer, HTML,PHP,WebDesigning
Web Development , SEO, SMO and So many other courses are available here.
Everything about OOPs (Object-oriented programming) in this slide we cover the all details about object-oriented programming using C++. we also discussed why C++ is called a subset of C.
In this class session, objects and classes are introduced along with a definition of what object orientated programming is. Addition topics that are covered include instantiation, reuse, encapsulation, and inheritance.
This presentation is a part of the COP2272C college level course taught at the Florida Polytechnic University located in Lakeland Florida. The purpose of this course is to introduce students to the C++ language and the fundamentals of object orientated programming..
The course is one semester in length and meets for 2 hours twice a week. The Instructor is Dr. Jim Anderson.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
1. OOPS THROUGH C++
Dr. Chandra Sekhar Sanaboina
Assistant Professor
Department of Computer Science and Engineering
University College of Engineering Kakinada
Jawaharlal Nehru Technological University Kakinada
Website: https://drcs.info
Youtube Link:
https://www.youtube.com/watch?v=nPjHraTbPeY&list=PLT1ngltOnlJiHbzVvjkU8VzQt9oam8ji4
3. AGENDA
• Difference between C and C++
• Evolution of C++
• Procedure Oriented Programming vs Object Oriented
Programming
• Key concepts of Object Oriented Programming
• Advantages and Disadvantages of OOP
3
4. PROCEDURE ORIENTED PROGRAMMING
• It means “a set of procedures” which is a “set of subroutines” or a “set of
functions“
• Functions are called repeatedly in a program to execute tasks performed by them
• Example: A program may involve collecting data from user (reading), performing
some kind of calculations on the collected data (calculation), and finally displaying the
result to the user when requested (printing). All the 3 tasks of reading, calculating and
printing can be written in a program with the help of 3 different functions which
performs these 3 different tasks.
4
5. A REAL WORLD EXAMPLE
• We are working for a vehicle parts manufacturer that needs to update it's online
inventory system. Boss tells us to program two similar but separate forms for a
website, one form that processes information about cars and one that does the
same for trucks
• For cars, we will need to record the following information:
• Color, Engine Size, Transmission Type, Number of doors
• For trucks, the information will be similar, but slightly different. We need:
• Color, Engine Size, Transmission Type, Cab Size, Towing Capacity
5
6. SCENARIO - 1
• Suppose that we suddenly need to add a bus form, that records the following
information:
• Color, Engine Size, Transmission Type, Number of passengers
• Procedural –
• We need to recreate the entire form, repeating the code for Color, Engine Size, and
Transmission Type.
• OOP -
• We simply extend the vehicle class with a bus class and add the method
numberOfPassengers
6
7. SCENARIO - 2
• Instead of storing color in a database like we previously did, for some strange
reason our client wants the color emailed to him
• Procedural –
• We change three different forms: cars, trucks, and buses to email the color to the client
rather than storing it in the database.
• OOP –
• We change the color method in the vehicle class and because the car, truck, and bus
classes all extend (or inherit from, to put it another way) the vehicle class, they are
automatically updated
7
8. SCENARIO - 3
• We want to move from a generic car to specific makes, for example: Nissan and
Creta
• Procedural –
• We create a new form for each make, repeating all of the code for generic car
information and adding the code specific to each make
• OOP –
• We extend the car class with a Nissan class and a Creta class and add methods for each
set of unique information for that car make
8
9. SCENARIO - 4
• We found a bug in the transmission type area of our form and need to fix it
• Procedural –
• We open and update each and every form
• OOP –
• We fix the transmission Type method in the vehicle class and the change
perpetuates in every class that inherits from it
9
10. WHY SWITCH TO C++
• Supports an OO approach to programming
• Classes
• Inheritance
• Polymorphism
• Exceptions
• Provides powerful features on top of a “fast” language
10
11. HOW TO SWITCH TO C++
1. Learn about differences
a. New tools (compilers, debuggers, etc.)
b. New libraries
c. New file naming conventions
d. New syntax
e. Available standards
2. Rethink programming approach
11
12. 1A. NEW TOOLS FOR C++
• Compiler: g++ or CC (CC is only on the SGIs)
• Debugger: gdb, dbx (SGI), cvd (SGI), or printf(). ;-)
• Some text editors “understand” C++. (formatting, syntax
highlighting)
12
13. 1B. NEW LIBRARIES FOR C++
• All of the C libraries still work
• Some C++ specific libraries
13
14. 1C. NEW FILE NAMING CONVENTIONS FOR C++
• Some conventions for file names
• foo.h, foo.c – file names under C
• foo.hh, foo.cc – file names under C++
• Also foo.cpp, foo.cxx – file names under C++
14
15. 1D. NEW SYNTAX
• Syntax virtually identical to C
• C++’s features add syntax
15
17. SOME QUESTIONS ABOUT C
• What is C?
• C is a low-level, procedural, systems programming language
• What problem did C solve?
• Designed as a system’s programming language for UNIX in the 1970s
• A fast, flexible, low-level language was needed.
17
18. SOME QUESTIONS ABOUT C++
• What is C++?
• C++ is an extension of C that provides support for object-oriented
programming
• What problem did it solve?
• Stroustrup states, “I built C++ as a bridge over which people would
pass from traditional programming to styles relying on data
abstraction and object-oriented programming.”
18
20. C VS C++
C C++
C is a Procedure Oriented Programming
Language
C++ is an Object Oriented Programming
Language
Top-Down Approach Bottom-Up Approach
C is less secure than C++ C++ is secure (Data Hiding)
C programming variable declaration is
possible only at top of the program
In C++, variable declaration can be
done anywhere in the program
In C, Namespace feature is not available In C++, Namespace feature is available
C is a middle level language C++ is a high level language
In C, programs are divided into modules
and Functions
In C++, programs are divided into
classes and Functions
Exception Handling not supported Supports Exception Handling
20
21. C VS C++
C C++
C Input and Output:
scanf(), printf()
C++ Input and Output:
Cin (>>), cout (<<)
In C, main() function can be called
through other functions
In C++, main() function cannot be
called through other functions
malloc(), calloc() functions are used
for dynamic memory allocation
new, delete operators are used for
allocating and deallocating memory
21
23. EVOLUTION OF C++
• It has a history going back to 1979
• Bjarne Stroustrup – Developed the C++
• He started work for his Ph.D. thesis
• He began work on "C with Classes", which as the name implies was
meant to be a superset of the C language
• His goal was to add object-oriented programming into the C
language which was and still is a language well-respected for its
portability without sacrificing speed or low-level functionality
• It included classes, basic inheritance, inlining, default
function arguments, and strong type checking in addition to
all the features of the C language
23
24. EVOLUTION OF C++ CONTD…
• In 1983 –
• the name of the language was changed from “C with Classes” to
C++
• The ++ operator in the C language is an operator for incrementing
a variable, which gives some insight into how Stroustrup regarded
the language
• Many new features were added around this time, the most notable
of which are virtual functions, function overloading, references with
the & symbol, the const keyword, and single-line comments using
two forward slashes
• In 1985 –
• C++ was implemented as a commercial product
• The language was not officially standardized yet
• In 1989 –
• The language was to include protected and static members, as well
as an inheritance from several classes.
24
25. EVOLUTION OF C++ CONTD…
• In 1990 –
• Turbo C++ was released as a commercial product
• Turbo C++ added a lot of additional libraries which have had a considerable impact on
C++'s development.
• In 1998 –
• the C++ standards committee published the first international standard for C++ ISO/IEC
14882:1998, which is informally known as C++98. The Standard Template Library, which
began its conceptual development in 1979, was also included.
• In 2003 –
• the committee responded to multiple problems that were reported with their 1998
standard and revised it accordingly. The changed language was named C++03.
• In mid-2011 –
• the new C++ standard (C++11) was finished
• The new features included Regex support, a randomization library, a new C++ time
library, atomics support, a standard threading library, a new for loop syntax providing
functionality similar to for each loops in certain other languages, the auto keyword, new
container classes, better support for unions and array-initialization lists and templates. 25
27. PROCEDURAL ORIENTED PROGRAMMING
VS
OBJECT ORIENTED PROGRAMMING
Procedure Oriented Programming Object Oriented Programming
In procedural programming, program is divided into small
parts called functions.
In object oriented programming, program is divided into
small parts called objects.
Procedural programming follows top down approach.
Object oriented programming follows bottom up
approach.
There is no access specifier in procedural programming.
Object oriented programming have access specifiers like
private, public, protected etc.
Adding new data and function is not easy. Adding new data and function is easy.
Procedural programming does not have any proper way for
hiding data so it is less secure.
Object oriented programming provides data hiding so it
is more secure.
In procedural programming, overloading is not possible. Overloading is possible in object oriented programming.
In procedural programming, function is more important
than data.
In object oriented programming, data is more important
than function.
Procedural programming is based on unreal world. Object oriented programming is based on real world.
Examples: C, FORTRAN, Pascal, Basic etc. Examples: C++, Java, Python, C# etc.
27
29. KEY CONCEPTS OF OOP
Major principles of Object Oriented Programming system are
• Class
• Object
• Inheritance
• Polymorphism
• Data Abstraction
• Encapsulation
29
30. CLASS
• Class -
• Classes are a blueprint or a set of instructions to build
a specific type of object
• It is a basic concept of Object-Oriented Programming
which revolve around the real-life entities
• Class determines how an object will behave and what
the object will contain
• class <class_name>
{
fields;
methods;
};
30
31. OBJECT
• Object
• is an instance of a class
• An object in OOPS is nothing but a self-contained
component which consists of methods and properties
to make a particular type of data useful
• For example color name, table, bag, barking
• When you send a message to an object, you are
asking the object to invoke or execute one of its
methods as defined in the class
• Syntax:
• Classname variable_name = new Classname();
31
32. CLASS VS OBJECTS
• A Class
• In object oriented programming class is a blueprint or prototype that defines the
variables and the methods (functions) common to all Objects of a certain kind
• An object
• In OOPS object is a specimen of a class
• Software objects are often used to model real-world objects you find in everyday
life
32
33. INHERITANCE
• Inheritance –
• Inheritance can be defined as the process where one class
acquires the properties, methods and fields of another
• With the use of inheritance the information is made
manageable in a hierarchical order
• The class which inherits the properties of the other is
known as subclass, derivedclass, childclass and the
class whose properties are inherited are known as
superclass, baseclass, parentclass
33
34. POLYMORPHISM
• Polymorphism –
• Allows us to use the same word to mean different things in different
contexts
• The capability of a method to do different things and take on many forms
based on the object that it is acting upon
• In other words, polymorphism allows you define one interface (or class)
and have multiple implementations
34
35. ABSTRACTION
• Abstraction-
• Allows for simple things to represent complexity
• Such as objects, classes, and variables representing more complex
underlying code and data
• We all know how to turn the TV on, but we don’t need to know how it
works in order to enjoy it
• For example in our code we could create a TV object then ask it to turn
on. We don’t need to worry about how the TV object works as long as
we know it has a on method within
• Consider the scanner import – we don’t worry about how it works we
just create a scanner object and use it when we want user input
• This is important because it lets avoid repeating the same work
multiple times.
35
36. ENCAPSULATION
• Encapsulation –
• Encapsulation is a mechanism of wrapping the data variables
and code acting on the data methods together as a single unit
• The variables of a class will be hidden from other classes, and
can be accessed only through the methods of their current class,
therefore it is also known as data hiding
• To achieve encapsulation, we declare the variables of a class as
private
• Provide public setter and getter methods to modify and view the
variables values
• We can re-use objects like code components or variables without
allowing open access to the data system-wide
36
38. ADVANTAGES
• Code Reusability
• Represents generic application concepts closely and are more
near to real world models
• Ease of programming
• Ease of Maintenance
• Ease in extension
• Ease in redesign
• Portability
• Scalability
• Compatibility with C
• Memory Management
38
39. DISADVANTAGES
• Designing OOP program is more tricky
• Planning in more important
• Good skills (Designing skills, Programming Skills and Thinking Skills) need to
acquired by the programmer
• Absence of Garbage Collector
• No Built-in threads
• Use of Pointers
39