Demystifying OOPs with C++
4.3 (31 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
168 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Demystifying OOPs with C++ to your Wishlist.

Add to Wishlist

Demystifying OOPs with C++

Walk through the wonderful world of C++
4.3 (31 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
168 students enrolled
Last updated 9/2017
Current price: $10 Original price: $135 Discount: 93% off
5 hours left at this price!
30-Day Money-Back Guarantee
  • 12.5 hours on-demand video
  • 3 Articles
  • 58 Supplemental Resources
  • Full lifetime access
  • Access on mobile and TV
What Will I Learn?
  • Master principles of Object Oriented Programming
  • Become proficient in understanding concepts of C++
  • Become expert in comprehending C++ source code
  • Become confident to face campus interview
View Curriculum
  • Student should have in-depth of knowledge of C language
  • Must have hands-on experience of writing programs
  • Must have and IDE or turbo C++ compiler i.e. TCC

Many a times C++ is regarded as replacement of stdio.h in C by iostream in C++, printf and scanf in C by cout and cin in C++ and structure in C by class in C++...

My objective is to take this course beyond that myths and impressions...

Learning C++ is not just syntax but far more than that. OOP was one of the revolution in s/w industry. Here is an attempt is made to teach concepts of C++ from philosophical point of view and not mere from programming perspective. OOP and C++ are the way we live, behave, act, respond, and exist in the world...!

I am making attempt in the world by mapping each implemented concept of OOP in C++ by mapping it to the real world. May be its first attempt in the world to teach in this manner by using animation.

Besides all features of C++ with OOP along with step by step explanation, I am going to put here notes, quiz, interview questions along with answers and assignments as well.

I am sure if understand the basics, Java, PHP, Python would not only be an easy cakewalk but you would love learning those in the future. So I am using numerous day-to-day examples to explain concepts.

Course starts from basics of programming methodologies and then covers each feature of C++ with detail analysis rather than mere explanation of programs.

Who is the target audience?
  • For those who want to know Object Oriented Programming methodology with real world examples
  • For those who don't want to learn mere syntax, but interested in knowing why C++ programs are written in OOP style
  • Absolutely essential for engineering and polytechnic students
  • Those who plan to learn Java, PHP and Python in the future
  • Suitable for those who want to make career in Software Engineering
  • For those who are comfortable with C
Students Who Viewed This Course Also Viewed
Curriculum For This Course
129 Lectures
Fundamental principles of Object Oriented Programming
21 Lectures 01:23:54


Shweta here...!

Here in this video I am introducing about me and the course


Preview 05:16

You can’t trust code that you did not totally create yourself...!
Ken Thompson

Here is the scope of subject and methodology which I am going to follow to explain the Object Oriented Programming with C++. Hope you enjoy my way of teaching.

Scope and Methodology

A language that doesn’t have everything is actually easier to program in than some that do...!
---Dennis Ritchie

  • In this topic I am taking you in the explore history of C++ language...
History of C++

If you don't know where you are going, road will get you there...!
...Lewis Carroll

After knowing history let's see the future...!

The Road Ahead

Measuring programming progress by lines of code is like measuring aircraft building progress by weight...!
---Bill Gates

If you have written C program, here is the methodology which you followed while writing C programs

Introduction to Procedure Oriented Programming

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it...!
---Brian Kernighan

This is just an overview of OOPs methodology in a nutshell

Philosophy of C

The main object of religion is not to get a human into heaven, but to get heaven into him...
---Thomas Hardy

Essence of being an Object

Without history, there would be no future...!

History of OOP

In order to be irreplaceable, One must always be different...!

Comparison between POP and OOP

The objects are very beautiful and important in and of themselves, but also because of the story they tell...
---David Silverman

Features of Object Oriented Programming

Sarcastic Saying..."Men will be Men"....and..."Boys will be boys"...

What's wrong in that...?

After all object are an instance of Class...!

Preview 07:57

Sometimes abstraction and encapsulation are at odds with performance — although not nearly as often as many developers believe — but it is always a good practice first to make your code right, and then make it fast...
---Brian Goetz


Upper classes are a nation's past;

The middle class is its future

....Ayn Rand


"Abstraction is selective ignorance...!"
-Andrew Koenig

The complexity of the problems you are able to solve is directly related to the kind and quality of Abstraction

Everywhere you look, you see them - objects..! People, animals, planes, cars, buildings, computers and the like. Human think in terms of objects. We have the marvelous ability of abstraction that enables us to view screen images as objects such as people, plane, trees, and mountains rather than as individual dots of color. We can, if we wish, think in terms of beaches rather than grains of sand, forests rather than trees, and houses rather than bricks...!


This method is to define as the class number of a class the class of all classes similar to given class...!
....Bertrand Russel


One Ring to Rule them all,
One Ring to find them,
One Ring to bring them all
and in the darkness bind them.

---John Ronald Reuel Tolkien


Only God can turn a Mess into a Message...!


A Message prepared in the mind reaches a mind...A message prepared in a life reaches a life...!

---Bill Gothard

God sends you lot of messages...Keep your senses open to receive them...!


Message Passing

In this dynamically changing world, you often take decisions dynamically...Don't you?


Dynamic binding

This penultimate topic covers applications of OOPs in the software industry.

Applications of OOPs methodology

Here we come to the end of first chapter... It was just introduction to two mmethodologies viz. POP & OOP.

Summary video would help you to recall everything learnt so far in this chapter...


Here is a fast quiz on fundamentals of OOPs

Cryptic Questions
30 questions

Here are a few assignments for you. You can discuss along with other students in the class and explore it.

Important Note

Programming assignments applicable to all contents in the curriculum have been provided in the chapter."Stream I/O in C++". If you are already well conversant with cout and cin, you can try those assignments simultaneously.  

Moving from C to C++
5 Lectures 42:59

What do you do when you plan to purchase any new gadget...? Ask this question to yourself and answer before you start this unit...!


Here is first set of differences between C and C++. You would learn various minor and major differences like commenting style in C and C++, size of character constant, difference in meaning of empty parenthesis in front of function, compilation rules, placement of variables declaration, initialization of global variables etc. in C and C++.

Don't just listen but pause while you view the code. Type it. Observe output in C and C++ compilers separately. I advise you to use old TC compiler for understanding the beauty of C as well as enhancement made by Stroustrup in C++.

Old TC compiler is available on the internet.

Note: You may find some different outputs than mentioned in the video. But I just want you to understand the attempts behind the possible enhancement.

Differences between C and C++ - Part 1

Here is second set of differences between C and C++ wherein you would learn how tag name of user defined data type differs between C and C++, const modifier, how return type of main function defers, how string constants are handles by C and C++, need of function prototype, type casting, new concepts like void pointer, compiler-only table etc.  

Differences between C and C++ - Part II

Here is third and final set of differences between C and C++. The topic starts with difference in default access category of structure in C and class in C++, and then it is followed by various concepts like scope resolution operator and typecasting methods in C and C++.  

Differences between C and C++ - Part III

Although it is possible to write portable programs, there are many programs among different C and C++ compilers and different computers that can ,make portability difficult to achieve. Simply writing programs in C and C++ does not guarantee portability. The programmer will often need to deal with compiler and computer variations. 

Here is summary of the topic. A small but very interested story has been narrated here for you. If you have enrolled for my other course "Demystifying C programming language" then you can skip this story. 


Take a Break...Take a  Quiz

The quiz is designed to refresh your knowledge of C programming as well along with C++

Cryptic Quiz
16 questions
Reference Variable in C++
7 Lectures 30:52

"I love nick names. It makes me feel loved. It makes me feel less alone in this world...!" 
---Ellen Page

Here in this topic you would be introduced to a new topic which is a wonderful facility directly imported from real world. 


Here is review of two popular concepts from functions in C i.e. 

  1. function call by value 
  2. function call by reference"  

Review is taken to understand power of reference variable in a better way. 

Preview 02:56

Here you will learn everything about reference variable in C++ i.e. syntax of reference variable and tips to use it appropriately.

Syntax of Reference Variable

Your computer and compiler are good teachers. If after carefully reading your C++ language manual you are not sure how a feature of C++ works, experiment using small test programs like in the previous chapters and see what happens. Se your compiler options for "Maximum warnings". Study each message you get when you compile your programs and correct the program to eliminate the message.  

Here is a sample program to understand theory learnt so far in last topic 

Sample Prorgam

Here is a single problem solved with three methods i.e. 

  1. function call by value
  2. function call by address
  3. function call be reference

Study carefully 

Cryptic Questions

Swapping contents of two variables using or without using 3rd variable has been second most popular program in while learning any hardcore computer programming language after famous "Hello World" program. And why not it should be? After all, any operating system works on this basic principle...!

Here is the interesting program using reference variable  

Swapping the contents

Here is the last video in this chapter which explains use of const while handling reference variable in C. At the end you would get to answers to 3 small but cryptic questions in this chapter. 

Const Reference and Cryptic Solutions

It's a break...Quiz time break

Cryptic Quiz
10 questions
Default function arguments
3 Lectures 12:31

Here is introduction to new small topic "Default function arguments". Try to understand its importance. The concepts has been intelligently used by many programming languages while writing libraries. I bet you, its really interesting feature of C++.

Preview 02:16

The arguments in function having default values can be categorized as Mandatory arguments and default arguments. Here is syntax of default arguments along with meaning of mandatory arguments and default arguments. Examples are hypothetical for understanding purpose only. Explore its use by thinking on your own. 

Syntax of default argument list

Here is a sample program written on the basis of real life example. Its a hypothetical program written in 3 different files for exploring power of default function arguments in C++

Sample program with 3 different versions

Take a break...Take a quiz

Cryptic Quiz
6 questions
Dynamic Memory Allocation
8 Lectures 58:15

Memory allocated to variables can be at either compile time or at run time. Here is introduction to dynamic memory allocation

Introduction to dynamic memory allocation

Here is explanation of everything about memory with the aid of data segment, logical partitions, scope and life etc. of variables and focus on heap

Inside memory

Here is first function from C, for allocation of memory dynamically. Its a library function.

Back to the C - the function malloc()

Here is explanation of one more memory allocation function calloc(). The video also covers explanation of the function free() which releases the memory from the heap.

Preview 07:00

Memory taken dynamically may proved to be insufficient and in such case the library function realloc() helps you to request for additional memory at run time. Here is how it works... 

Insufficient memory...? Here is realloc()

Here we are to study how memory can be taken from the heap at run time in C++. 

"New" way of Dynamic Memory Allocation in C++

new in C++ is versatile operator proposed by Prof. Stroustrup. Here is more about new in C++.

New and delete

Here is summary of this chapter so far we learnt. 


A short Break...It's Quiz time

Cryptic Quiz
6 questions
Classes and Objects
19 Lectures 02:01:03

A physician, a civil engineer, and a computer scientist were arguing about what was the oldest profession in the world. 

The physician remarked, "Well, in the Bible, it says that God created Eve from a rib taken out of Adam. This clearly required surgery, and so I can rightly claim that mine is the oldest profession in the world." 

The civil engineer interrupted, and said, "But even earlier in the book of Genesis, it states that God created the order of the heavens and the earth from out of the chaos. This was the first and certainly the most spectacular application of civil engineering. Therefore, fair doctor, you are wrong: mine is the oldest profession in the world." 

The computer scientist leaned back in her chair, smiled, and then said confidently, "Ah, but who do you think created the chaos?"

Here is introduction to classes and objects in the world...!


Class in C++ resembles structure in C. Though both are user defined data types, major difference exists between class and structure. Here is brief about structure in C. Might be revision for you. But take it. 

Structure - The Driving Force

Let's have a look at difference between structure in C and class in C++. 

Difference between Structure and Class

In C you might have heard the term "Data Type". This type has been given new dimension in C++. Here it is how...!

Type in C++

Here is how class in C++ can be designed...

Class Design - Part 1

Let's have a look at syntax of the class

Preview 03:53

It's the Encapsulation, which gives you the power of Data Hiding and Data inaccessibility... Here is more about Encapsulation in C++

Encapsulation in C++

Here is roles of access specifiers viz. private, public and protected while designing the class

Class Access Categories

Here is the video which explains information that can be retrieved by user of a class just by looking at the class design. 

Class Design - Part 2

Here is first program of C++ using class. You would find detail analysis of scope resolution operator at the end of the topic. 

First Crush with Class

The Question "How does one write good programs in C++?" is very similar to the question "How does one write good English prose?" There are two answers: "Know what you want to say" and "Practice. Imitate good writing". Both appear to be appropriate for C++ as they are for English - and hard to follow. 
Bjarne Stroustrup 

Here is inside view of typical C++ program written using class

First C++ Program

Let's feel the pains if we have to mimic the class program in C++ using structures in C

Back to the C

Here are very interesting sample codes to create instance on the stack, an array of instances, an instance on the heap and and an array of instances on the heap. 

Playing with the Class and Objects

In the last century "Landline" phone used to be popular gadget at home as well as commercial premises. Then came the mobile, "a personal gadget". However both has got it's own pros and cons. 

"Inline functions in C++", I would say is same kind of mechanism....!

Don't take it literally :)

Inline Function

Here is the video to extend default functions arguments learnt in the 4th chapter in the context of "Class in C++" 

Default function arguments in class

Here is discussion about const member functions in a C++ class. 

Accessor functions

Like variable of primitive data type, reference to instance of user defined class can be created. This is exhaustively used while writing C++ applications. Listen carefully the philosophy behind this concept.  

Reference of an Instance

"A true relationship has tears"

Here is a video which explains relationship between container class and containing class. 

Both programs explained have been attached herewith in resources so that you can type, compile and execute them to explore intricacies of containing class relationship.

Has-a Relationship

Here is the last topic of this chapter. Try to understand the program. Study it carefully before you go to the next chapter. 

Cryptic Class

Please don't take this quiz right now if you are absolutely new to C++ programming language. This is going to last topic only after a few more topics are uploaded. Thank you for reaching here and your patience.

Cryptic Quiz
20 questions
Manager functions in C++
14 Lectures 01:24:49

This topic is continuation to the last topic in last chapter. You would understand this chapter only when you have understood philosophy of class containing pointer data member.  

Need of constructor and destructor functions

In this topic you will understand everything about basics of constructor like its syntax rules, when it is called, and when not called. 

Constructor in C++

Here is a counterpart of constructor in the previous topic and it is Destructor in C++. I have taken small and simple programs on the background of animation to explain flow control and concepts. You need to be very carefully as you need to given attention on various parts of the screen at a time. 

Destructor in C++

Here is one of the important concept of the constructor i.e Default Constructor. It is usually expressed in single line. But I am elaborating it taking its importance into consideration. 

So in all programs written till date were having a default constructor (hidden though) supplied by the constructor.

Try to apply analogy in our day-to-day life if you can after completion of this topic. Human too behave like a compiler. 

Default Constructor and Destructor

Constructor taking single argument is different than constructor taking multiple arguments. So this case is dealt here separately. Try to understand the importance. 

Constructor taking one argument

The video explains you need of writing default constructor if user takes part in writing explicit constructors for instance initialization. The source code is attached here for download. 

Sample Program on Constructor

Here is a program of constructor taking two arguments. Try to understand importance and difference between constructor taking single argument and multiple arguments. Source code is attached so that you can try it on your own machine

Constructor taking multiple arguments

When you give some article as a gift to anybody you love, you wrap it in a "Gift box". Though this "Gift box" is temporary, it is necessary. The temporary instance in C++ is the same which is created internally by the compiler. Your job as a programmer is to make provision by way of provision of a suitable constructor. The same is explained it here. The concept is difficult to understand by reading book. So extensive animation is used to explain the same. I hope you understand the underlying philosophy.

The source code is made available for downloading so that you can test the program on your machine and understand control flow of each step. 

Implicit Type Conversion

Here is a small program containing class having constructor taking two arguments with default values. Source code is also provided to download. Try this program on your machine.  

Default Constructor

Initializing 1 instance with existing instance is one of the important feature of Copy Constructor. 

Though compiler provides default copy constructor, it's of no use if class data member is of pointer.

Study the program carefully to understand Shallow Copy 

Shallow Copy

In this video you would understand

  • What is deep copy?
  • What is the need of user defined copy constructor?
  • What are the differences between a shallow copy and a deep copy?

Note: Programs explained in the video are made available to download. Don't copy programs but type them on your own.

Deep Copy

Though constructor is said to be used for initialization of an object at the time of creation, it's not true initialization but and assignment. 

Here is video which explains difference between an Initialization and an Assignment in C++ context 

Initialization v/s Assignment

Here is the solution provided by Stroustrup to address issues in the last topic. You would learn

  • Base/member initialization list in this topic
  • Syntax to implement
Base/Member initialization list

Sample Programs
Special Class features
11 Lectures 01:03:26

Here is I am with one more important topic to discuss special features of Class in C++. This would be introduction to this topic "Special Class Features". 


The topic is difficult to understand. Try to listen and view contents of the video. I am trying to convey, how member function of the class knows which instance he is going to act. 

It is the special pointer called "this pointer" which makes it possible.     

Introduction to "this" pointer

Since, the concept of "this" pointer is difficult to understand, I am taking two similar looking programs. First is in C++ language and second in C language performing same task in same manner. 

You would be able to understand 

  • the role of this pointer
  • How it works in the background
  • Facility provided by Stroustrup 
Sample programs on this pointer

Here is wonderful application of this pointer. It's not just an application but is a special feature of C++ provided by Stroustrup. 

Functions in C++ can be concatenated and topic shows how to achieve it. 

You would learn mystery behind the screen 

Function Chaining

At the end of this small topic, you will understand 

  • Difference between C Structure and C++ class WRT Static Data Member
  • What is the Static data member

Static Data Member - An Introduction

Here are two programs to understand fundamentals of static data. 

In the next topic I have provided source codes of static data member of containing class.

Static Data Member - Sample Program

At the end of this topic, you would be able to understand importance and syntax of static member function. Source codes explained in the video have been made available for download. 

Static Member Function

You would learn what is the friend function in C++ at the end of this topic. 

Introducing Friend

Here is a sample program to understand implementation of friend function in C++

Sample Program on Friend Function

You would learn 

  1. Use of friend function while operating on two instances of a class
  2. A single function friend of two classes
  3. Friend class
Various friends...!

Here we come to the end of this chapter. 

Last few words about friends...!
Function overloading in C++
12 Lectures 01:12:00

Here is an Introduction to Polymorphism in C++

Introduction to function overloading

You will learn 5-steps algorithm of argument matching while calling a function. 

Argument matching Algorithm

You would learn how function is called at compile time when multiple functions are available in the class according to the first rule "Exact match" and sub rule "Trivial conversion". 

Rule 1: Exact Match and Trivial Conversions

When first rules fails, compiler goes for matching using promotion. This involves argument promotion from 

  • char to int 
  • float to double

Rule 2: Match using Promotions

Here are second set of argument matching rules as:

  1. Standard conversion
  2. User defined conversion
  3. Match using ellipsis (...) 
Rule 3-4-5

In this video you will get a glimpse of an important concept called "Name Mangling". Concept is based on the "Function overloading in C++". If you fail to understand how to view the object file, feel free to ask me.  

If you want to explore further, you can download the PDF file attached here in the resources and try,

Name Mangling

Don't get confused by the title. Operator overloading is not available in C. However I am just trying to convey that Stroustrup found roots of "Operator Overloading in C++" in the C language through his eyes. Just try to understand what I mean in this video.  

Operator overloading in C

Here is a video to understand operator overloading in C++. View and listen the contents carefully. Watch it again and again if you fail to understand the concept completely.   

Operator overloading in C++

Here is a video which is going to explain you what goes under the hood when you overload the operator in C++. You would also learn the much awaited concept of C++ i.e. cout and cin and its connection along with various previous concepts like this pointer, object, class, function chaining, and operator overloading. 

Predefined objects: The famous cin and cout

Here are rules of overloading unary and binary operators for member as well as global friend functions. Carefully view and listen functional notation of infix notation. 

Rules of Operator Overloading

Here is a program to explain operator overloading concept for both unary as well as binary operators. I have taken a user defined String class for explaining almost all concepts you learned since the first chapter of this course. 

I am keeping source code of this program in download section. 

Carefully study the program

User defined String class

Here is a very interesting program to understand "how compiler differentiate between post-fix and prefix increment operator as a part of expression". 

The program is followed by the summary  

Functional notation of prefix and post-fix increment operator
Inheritance in C++
13 Lectures 01:20:50

The feature "Inheritance" of OOPs has been discussed earlier. Now in this chapter we will see ways to implement it. This chapter takes a quick introduction to Inheritance 


Here is a simple example of Inheritance in action before we study the syntax in the next topic,

Inheritance example

Here is a definition of Inheritance followed by the general syntax.  


This video explains behavior of class members of base class when a new class is derived from an existing class and if type of derivation is private. 

In this video you would understand what happens to private members of base class and public members of base class in inheritance. 

Private Derivation

Here are a bit complex concepts of inheritance to explain in best possible way. Listen to this video carefully again and again. 

Public and Protected Derivation

Here is summary of access specifier. So you would learn what happens with private, protected and public members of the base class when they are inherited with private, public and protected derivation. Listen carefully. Listen again and again. It will take some time to imbibe the concepts. 

Summary of Access specifier

Here is a first program to understand:

  • How to access base class members using derived class instance
  • How to override base class member

At the end you will also learn, the summary of compiler look-up rules to access data as well as functions

Compiler look-up rules

As discussed in the last chapter, function overloading can occur in the single scope. So when you redefine the function in case of inheritance, you are not actually overloading but overriding it. Two programs explained in the video make it clear. Same programs have been added in the resource for ready reference.  

Difference between Overloading and Overriding

Here is a video to see how constructor and destructors are called when class is inherited. You would understand that it is the responsibility of derived class to call base class constructor explicitly in base-member initialization list.

Constructor - Destructor in Inheritance

Here is the modified version of the previous program wherein I am explaining "How to initialize one instance of the derived class using existing class" by appropriate use of copy constructor

Copy Constructor in Inheritance

Here is operator overloading in Inheritance. We have already seen a separate chapter how to overload an operator in single class. This video explains method to overload an assignment operator when class is derived. I am taking a simple program to understand difficult concept of inheritance. Listen and view the program flow, code statements, design and syntax again and again to understand the program philosophy. 

The source code is provided in the resources section for downloading. 

Programs in this chapter are difficult to understand so please be careful while watching these videos in this section as well as previous sections of this chapter. 

Operator overloading in Inheritance

Here is a video to understand casting of base class instance into derived class, particularly when instance is created on the heap at run time. 

Many such concepts last few topics and this are seemingly pure theoretical. However these concepts would definitely help you in the future. So as of now don't think about its application or use while writing programs at academic level. 

However, this knowledge would definitely help you to face serious interview questions...! 

Casting from base to derived

Here is a video to understand casting of derived class instance into base class, particularly when instance of derived class is created on the heap at run time and stored in the base class pointer. 

Many such concepts last few topics and this are seemingly pure theoretical. However these concepts would definitely help you in the future. So as of now don't think about its application or use while writing programs at academic level. 

  • However, this knowledge would definitely help you to face serious interview questions...! 
Casting from derived to base
3 More Sections
About the Instructor
Bhalchandra Gholkar
4.5 Average rating
150 Reviews
803 Students
4 Courses
Creating innovative e-contents for programming languages

Post graduate Engineer... Computer Programming language trainer for last 15 years... Passionate about teaching and have taught personally over 3500 students. Currently my team is developing unique methodology for teaching programming language to the masses at lowest possible price. My team has tried to develop absolutely out of the box e-learning contents similar to Crafting a diamond.... for those who want to understand language concepts...

Daryl Newell
4.5 Average rating
128 Reviews
732 Students
2 Courses
Electronics Engineering and Programing for Over 20 Years

I studied electronics as an Electronic Engineering Technologist at DeVry University. In working in the Audio Video and consumer electronics field since 1994, I have written and used C and C++ programs for work and to help automate every day computer tasks from stock trading applications to Graphical, Standard Deviation calculators. It is a pleasure to help others in topics that I have already spent so much time learning. For over the last 20 years I have been continually updating and practicing C and C+ programming skills.

I hope you enjoy the course.