Transcripts
1. Introduction To C++ Course: E to the complete
beginner course of C plus plus
programming language. This course consists
of different classes. We are going to discuss
about the concepts like how to run the C plus plus program
in visual studio code, variables, data
types, loops, array, object oriented concept in C plus plus
programming language. So this course is very, very useful for the
beginners who are trying to learn C plus plus
for the first time. So let's get started.
2. C++ Class 1 : Introduction To C++: Welcome everyone.
In today's flash, we're going to discuss about
introduction to C plus plus. C plus plus is an middle
level programming language developed in the year 19179. C plus plus is an extension of C programming language with
Object oriented concept. It is an extension with
Object oriented concept. C plus plus is one of the Evergreen
programming language and loud by millions of
software developers. C plus plus is one of the
Evergreen programming language. So this is the introduction
to C plus plus. So after that, we
are going to discuss about advantages of C plus plus. So the first advantage
is performance. So C plus plus is high
performance language. Making is suitable for
intensive applications. If you want to create
any large projects, you can use C plus plus
programming language. And then second is
nothing but flexibility. So C plus plus offers
wide range of features, allowing for low level access and then high level abstracts. So C plus plus contains
wide range of features. So that's the second advantage. And then third advantage is nothing but so C plus plus have more number of libraries compared to C
programming language. So these are all the advantages of C plus plus
programming language. So after that, we are
going to discuss about the drawbacks of C plus
plus programming language. So the first tone
is the complexity. So C plus plus syntax is more difficult than Python
programming syntax. So that's the first
that's the complexity, and then memory management. So C requires manual
memory management so that's the second
disadvantage. And then third one is
the compiled time. So the compiled time of C plus plus programming
language is more compared to other
programming language. After that, we are
going to discuss about the applications that can be
created using C plus plus. So the first application
that can be created using C plus plus is nothing
but game development. You can create game development using C plus plus
programming language. So and then second
application is nothing but high
performance computing. So C plus plus can be useful for high performance
computation. So after that, we are
going to discuss about the job opportunities
of C plus plus. If you learn C plus plus
programming language, you can achieve these jobs like system programming
and game development and embedded system developer. So these jobs can be
achieved when you learn C plus plus programming
language. So that's it, guys. In today's class,
we discussed about the introduction to C plus
plus programming language. In the next class, we are
going to discuss about how to run C plus plus
in Visual Studio code.
3. C++ Class 2 : Running C++ in Vscode: Everyone. In today's slides, we are going to discuss
about how to run C plus plus program in
Visual Studio code. Also, you can see other ID for running C plus plus program. You can see the ID
like the C plus plus, Eclipse, code light,
code blocks, turbos. But we are going to use VS code for running the
C plus plus program. For that, you need to create a new folder for your
C plus plus program, and then you have to open
that folder with VS code. So after opening the VS code, you need to install some of the extension for running
the C plus plus program. For that, you need
to open the Google, and then you have to type Min 64 Min W 64
minimalist download. So you have to open
the first website, and then you have
to download that. So after the download
is completed, you need to install that, and then you have
to select some of the settings like
Continue, continue. And then you need to select
the options like GCC, C plus plus, and base. After that, you need
to select Install. Then all the packages will
be installed in the Min. Then you have to
open the C folder, and then you have
to search for Min. So you have to open
the Bin folder, you have to copy the path of the BNFolder and
then you have to paste that path inside the
environment variables. For that, you have to open the properties so
inside the properties, you have to open
advanced system settings in that you have to open
the environment variables, and then you have to
copy paste the path of the bin folder in
the user variables, and also system variables. After that, only you can run the C plus plus program
in Visual Studio code. So in the Visual Studio code, you need to install the
extension like C plus plus. After installing that extension, you need to create a new file. For that, you need to
select new file Opson, so you need to type the name
of your file and going to type sample dot C plus plus. So that's the extension for creating the C
plus plus program. So now we are going to
discuss about how to run our first program in
Visual Studio code. For that, you need to
type the header file, you have to type has
include Ivo stream. So that's the header file, and then you need to
create name space so you need to type
using namespace STD. That is nothing but standard. So after that, you need
to create main function, oto type in main off. So inside the Carly brackets, we are going to
print our output. So we are going to
print hller world. For that IN to type C out, and then I to type the symbol
less than and less than, and then in to type
the double quotation inside that in to
type hello world. At last in to type semicolon
to end the statement. So this is the syntax for creating the C
plus plus program. So after that, you need to run the code so you can see
the output ha world. So that's it, guys.
In today's class, we are discussed
about how to run the C plus plus program
in Visual Studio code.
4. C++ Class 3 : Variables: Welcome, everyone.
In today's class, we are going to discuss about
variables in C plus plus. So variable, it is a container which is
stored data value. So that's the concept
of variables. Nitotype has include IO stream. So IO is nothing
but input output. And then you need to
create namespace standard. So after that, you need to
create the main function. You need to type int main off. So inside the main function, we are going to
create variables. So before typing the variables, you need to create data type. So the data type can be Int. So you need to type
Int A equal to ten. So you need to type int, and then you need
to type the name of the variable equal to value. You can type your value ten. So A is a container which
is stores the value ten. So this is how you can create
variables in C plus plus. So that's the syntax. So after that, if you want
to print the variable, you need to type C out. So you have to type C out. So inside that, you need
to type the variable A. So inside the C out, you need to type the variable A. So this will print
the output ten. So that's it guys
in today's class, we are discussed about how to create variables in C plus plus.
5. C++ Class 4 : Datatype: Everyone. In today's class, we are going to discuss
about the concept of data type in C plus plus. So there are many data type. So the first one is
the integer data type and character data type, float data type,
string data type, boolean data type,
and double data type. We are going to see an example for these data types one by one. So you need to type has
include IVO, stream, header f, and then you have to type
the name space using name space, STD, standard. And then you need to
create the main function, int main of so inside
the main function, we need to create data type. So you have to type data
type int A equal to ten. So it is considered
as integer data type, and float B equal to 1,013.55. So that's the float theta
type and character C equal t. You need to type
single quotation A, and then string S equal t, double quotation Hala world. And then I equal ty 12.555. And then Boolean data type
bool X equaltt R false. So this is the data type
declaration and initialization. So this is how you can create
data type in C plus plus. So after that, if you
want to print the values, you have to use CO. So to type C out, and then A. So you need to run the code. So you can see the output ten. So if you want to
clear the output, you need to type CNS. It will clear the screen. So I'm going to
change the variable to B and then run the code. You can see the output 13.55. That's the float. So if
I want to print boolean, I'm going to type X and then save the file
and run the file. So you can see the output one. For true, it will sew one, for false, it will sew zero. And then, will be string world. So this is how you can create
data type in C plus plus.
6. C++ Class 5 : User Input: Welcome, everyone.
In today's class, we are going to
discuss about how to get user input in C plus plus. So before that, you need
to include the head turfs. So you need to types
include IO stream. And then need to type the name space using
namespace standard, and then you need to
create main function. So inside the main function, we are going to get
the user input. Before that, we need to ask
the user input for that you need to type C out
and enter any number. So we are going to ask
integer from the user. And then you need to type C in, I will read the input. So then you need to
type the value A. Before that, you need
to declare the value. And then you have to type
the variable. That's A. So after that, we are going
to print the value of a variable and then you have
to type the variable A. So this is how you can get user input and then
print the user input. First, you need to
type the variable, and then you have to
ask for the input, and then you need to store
the input in the A variable. And then you need to print
the A variable output. So you have to run the code, you can see the output, enter any number, you have
to type any number ten. So that's the output. So this is how you can get
user input in C plus plus.
7. C++ Class 6 : Logical Operator: Alto everyone, in today's
class we are going to discuss about logical operator
in C plus plus. So there are three logical
operators and are not. First, we are going to discuss
about unlogical operator. For that, you need to
create two variables, A cultuten and B qualify. So after that, we are going to print the unlogical operator, you need to type C out, and then you have to type
minimum two condition. A greater than B, and
then you have to type the symbol of and and
then A less than B. So before the condition, you have to type bracket. So if you don't
type the bracket, it will sew on error. So in unlogical operator, both condition must be true. If any one of the
condition is false, then the output will so falls. So that's the concept
of unlogical operator. So the first condition
is a greater than B. Yes, the condition is satisfied. But the second condition
is a less than B, then the output will so falls. So you can see the output, zero, zero is nothing but false. After that, we are
going to discuss about our logical operator for
that Dnion to type C out, and then you need to
type the condition. A greater than B and
then a less than B. In our logical operator, any one condition must be true. Then the output will so true. If both condition are false, then the output source false. So you can see the first
condition is satisfied, then the output will so
one, one is for true. So to run the code, you can see the output one. So zero is for false
and one for true. Because the first
condition is satisfied. So after that, we
are going to discuss about naught logical operator. So you have to type
the condition for non logical operator A greater
than B and A less than B. Before that, you need to
type the symbol of naught. So naught logical
operator is nothing, but it will reverse the output. We know that logical operator
output source false, but so naught will reverse
the output to true. True becomes false,
pause becomes true. So you need to run the code. So can see the output, so you can see the
output, zero, one, one. So zero is far and we
know that that is false. And then one for true. And then one for naught. So naught will
reverse the output. True becomes false,
false becomes true. So that's it, guys. In today's class,
we are discussed about logical operators
in C plus plus.
8. C++ Class 7 : If Else: Welcome everyone. In today's class we
are going to discuss about IFs conditional
statement in C plus plus. So first, you need to create
a head there fle for that to type as include IO stream that is nothing
but input output, and then you have to
type the name space to type using name space STD. After that, you have to
create main function. So inside the main function, we are going to
create two variables. So you have to type the
data type int A equal to ten and then in B equal to 20. So first, we are going to discuss about if
conditional statement, you have to type the I keyword and then you have to
type the condition. Inside the bracket, you
have to type the condition. A greater than B. So
inside the curly brackets, you have to type the output. So you have to type C out. A is greater than B. So if the I condition
is satisfied, it will print the output. A is greater than B. And then you have to type slash N for printing the output in the new line So if the if
condition is not satisfied, we are going to print s if, for that, you need
to type the syntax, s if and then you have to type the condition A
equality equal to B. After that, you need
to print C out, A is equal to equal to B. So if two conditions
are not satisfied, then we will print s.
We have to type ls, C out, B is greater than A. First, we have created
two variables. We know that A value is
lesser than B value. Then's condition will
print the output. B is greater than A, you have to run the code. So you can see the output. B is greater than A.
So that's it, guys. In today's class, we
are discussed about conditional statement in C plus plus
programming language.
9. C++ Class 8 : Switch: Welcome, everyone.
In today's class, we are going to discuss
about switch in C plus plus. So switch is also a
conditional statement. It is an alternative to E fels. So you need to type the head thepis and then to
time the name space. After that, you have to
create the main function. So inside the main function, we are going to
discuss about switch. So before that in to create variable for that in to
type in the equal to two. So that's our variable. And then we are going
to type switch. Inside that, you have
to type the variable. Using that day, we are
going to create condisons. So the conditions are s so you can create many
cases for your program. First, you need to create s one. If the s one is satisfied, it will print the output Monday. So you have to
type C out Monday. And then you have to type break. So if you don't type break, other cases will be
printed in the output. And then and then I'm going
to create second case, Go to print to stay. So if the second
case is satisfied, it will print the
output to stay. Also, you to type break. So if two cases
are non satisfied, or if the input is invalid, you have to type default case. Inside that you need to type invalid input or default answer. You can type your own answer, and then to type break. If the condition is satisfied, it will exit the switch
used in the brake. So you need to run the code
so you can see the output Tuesday because the value of day is satisfied with
the second condition, then the output will so Tuesday. If I change the value to one and save the file
and run the file, so you can see the
output Monday. The day value is satisfied
with the case one value. If I type in value
today and run the code, you can see the default answer. This is how you can create
switch in C plus plus.
10. C++ Class 9 : While Loop: Welcome, everyone.
In today's class, we're going to discuss
about loops in C plus plus
programming language. So loops are very, very important in
programming language. For example, if I want to print Hala world for more than
ten times, for default, I'm going to type C out, and then Hala world, Hala world, hala world for ten times. For this problem, the loops are introduced in
programming language. So loops are based
on some condition. So if the condition
is satisfied, then it will print the output. So we are going to see
an exam how to print halo world for ten times
using the while lobe. Before that, you need to
include the header files, so you need to type IO stream. And then you need to type the
name space a TD standard, and then input main, and then you have to type
the main function in main. Inside the main function, we are going to create
variable for Hala world. So you have to type
the data type stream a cult halo world. So we are going to print
hello world for ten times. And then you have to type the starting value for the loop, so you have to type
I equal to one. You can type your
own starting value, whether it is zero or one. And then you have to
type the wild keyword. So inside the while you
have to type the condition. So condition are very important. I ester are equal to ten. So if the condition
is satisfied, the loop will print the output
halor world for ten times. So the condition is one
less than are equal to ten, as the condition is satisfied, then we will print
the hala world. For printing the hala world, you need to type C out, see how to type C out, and then the variable
name that is EA. Also, you have to type slash N for printing the output
in the next line. So if you want to print the
hala world for ten times, you need to increment
the value by one by one. So the condition is one
ssa are equal to ten. Yes, the condition is satisfied, Hala world will be
printed one time. Then the value will
be incremented to two less are equal to ten. The condition is satisfied. Then the output will print halo world for the second time. So based on the condition, it will print the value. So I have to run the code so you can see the output
halo world Hala world for ten times. So this is how you can use
Wil Loop in C plus plus.
11. C++ Class 10 : For Loop: Hello, everyone.
In today's class we are going to
discuss about how to print halo world for ten
times using the far loop. So you need to type
the head Derfs and then name space and
then main function. Inside the main function, you need to create the
string halo world. So after that, you need
to type the far loop. So inside the R,
you need to type the starting value
in I equal to one. And then you need to type the condition I less
than equal to ten. You have to type I plus plus. So this is the syntax for creating the far
loop in C plus plus. First, you need to type
the starting value, and then you need to
type the condition. The condition is one less
than or equal to ten. The condition is satisfied, then the value will be
printed one by one. Hala world will be
printed one by one, using the I plus plus. For printing the hala world, you need to type C out, A, and then you need
to type SlasN for new line so A will print the
Hala world for ten times. So you need to run the code.
You can see the output. Hala world is printed ten
times using the far loop. So this is how you can use
far loop in C plus plus.
12. C++ Class 11 : Break & Continue: Come, everyone. In today's
class we are going to discuss about break and continue
in C plus plus. So break will exit the loop when the
condition is satisfied. Continue will skip
the particular value in the loop when the
condition is satisfied. For break and continue, we are going to see an
example using the far loop. So you need to type the header
file and name space and main method and then type
the syntax of far loop. First, inuk type the starting
value and then condition, and then increment value. So inside the far loop, you need to type the condition. So if the value of I becomes Pi, we will break the loop
using the break keyword. So you have to type, break. When the value of I
incremented to Phi, then we will break the loop. After that, you need to
print the value, C out, so you have to type C out, I, I will print the value. And then you need to type
slash N for new line. So after that, you need to run the code so you can see the
output one, two, three, four. When the value of
I becomes five, it will exit the loop
using the break. So after that, we are going
to discuss about continue. So if the value of
I becomes five, then value will be
stipped in the loop. You can see the output
one, two, three, four, six, seven,
eight, nine, ten. Five will be stipped in the
loop using the continue. So that's the difference
between break and continue. Break will exit the loop, continue will skip the
particular value in the loop.
13. C++ Class 12 : Array: Come everyone. In today's
class we're going to discuss about how to create
RA in C plus plus. RA is data type, which is those elements. For that, we are going
to see an example how to create array before the D type, the header fives for that
N to type has include IO stream type, namespace, STD, after that Nio type, the main function in main of
inside the main function, we are going to create array. So you have to type the
data type for the array, and then you need to type
the name of the array, square bracket equal
to Carl brackets. Inside the Carl brackets, you have to type the element, ten, 20, 40, 30 50. So this is how you can
create array in C plus plus, so that's the syntax. So after that, we are going
to create character array. Inside the Carli brackets, you need to type the character, single quotation. A and C. And B. As after that, we are going to
create string array. So inside the curly brackets, you have to type string, hello, and then wold. So this is how you can create string array in C plus plus. That you need to know
about the concept of index position. So array is based on the index. So the index start from zero, one, two, three, four, up to the element value. So ten is the zero index, 20 is the first index, 30 is the second index, 40 is the third index, 50 is the fourth index. So if you want to access
any element in the array, you need to access them
by using index position. So for that, we are
going to see an example. You need to type C out. You have to type the
index position zero. We are going to print the value ten using the index
position zero. So you have to run the code. So you can see the output ten. So this is how you can print the single element in the array. So if you want to print all
the elements in the array, you have to create far look. For that, we are going
to see an example. We have to type four. You
have to type starting value, I equal to zero. So that's the index zero, and then I sster
are equal to five, and then I plus plus. So inside the far loop, you need to print the
array for that No type C out and then you have
to type A, A of I. It will print all the elements
in the A array one by one. You have to type
SAS N for new line, you have to run the code you can see the output
ten, 20, 40, 50. So if you want to
remove the minus two, you have to change
the condition. So based on the index position, you have to create
the condition. I less than five and
then run the code. So you can see the output ten, 20, 30, 40, 50. So based on the index position,
index value positions, we have to create
the condition and starting value. So
that's it, guys. In today's class we
are discussed about how to create RA in C plus plus.
14. C++ Class 13 : Class & Object: Welcome everyone.
In today's class, we are going to
discuss about how to create class and
object in C plus plus. So class and object are nothing but object oriented concepts. So before that, you need to
include the header files, you need to type IO stream, and then you have to
create namespace. You have to type
using name space STD. So after that, you
need to create class. For creating the class,
you have to type class. That's the keyword, and then you need to type the
name of the class. So the name of the
class must be same with your file
name. That is Ops. After that, you need to type semicolon to end the statement. So if you don't
type the semicolon, it will generate an error. So this is the syntax
for creating the class. In C plus plus, you need to know about the concept
of access specifier. So there are many
access specifier, but we are going to discuss
about public and private. So if you want to
create any public class or public variables
or public functions, you need to declare
that inside the class. You have to type Bublic colon. After that, you need
to type the variables. We are going to create
bubblic variables, which can be accessed
by everyone. So I'm going to type
in A equal to ten. So we are going to create
Bubblic A variable. So after that, we
are going to discuss about how to create
object for the class. So you need to create
the main function. Inside the main function, we can create the object. For creating the object, you need to type the
name of the class. You have to type Oops, and then you have to
type the object name OB. So this is how you
can create object. So using the OB, we
can print the output. You have to type b dot a. It will print the output ten. You have to run the code. So
you can see the output ten. So this is how you
can create class and object in C plus plus. So if I change the access specifier from
public to private, you cannot access the value. Only inside the class,
you can access. Outside the class,
you cannot access. So you can see the error, A is private within the class. Within the class you can access. Outside the class,
you cannot access.
15. C++ Class 14 : Constructor: Welcome, everyone.
In today's class, we are going to
discuss about how to create constructor
in C plus plus. So we're going to see an exam. Well, how to create constructor. Before that, you need
to type the header pi. See how to type has
include Iotream. And then you have to create
the namespace standard, and then you have to
create the class. So how to type the
name of the class. So the name will
be the file name. And then you have
to put semicolon. So inside the class, we are
going to create constructor. So to type Bublik. So you have to type the
keyword constructor. So this is the constructor
for our class. So inside that, you can print
the output using the C out, you have to type C
out, constructor. In C plus plus. So this is how you can
create constructor in class. So after that, we are
going to create object, so you have to type
the main function. So inside that, we are going to create object for the class. For creating the object, you have to type the class name, so you have to type the
class name, constructor, and then you have
to type the object O B one, that's the object. See how to run the code. So you can see the output
constructor in C plus plus. That's it, guys.
In today's class, we'll discuss about how to create constructor
in C plus plus.
16. C++ Class 15 : Method: Welcome, everyone.
In today's class, we are going to
discuss about how to create methods in class. For that, we are going
to see an example. So you need to type
the header file, so you have to type IO
stream at this input output. If you want to print
or get any input, you have to include that. And then you need to
type the name space STD, and then you have
to type the class. So class and then you have to
type the name of the class. That will be same as file name, and then you have to type
semicolon to the class. So that's the syntax. So inside the class, we are going to create bubblic method. That you have to type bub colon, and then you need to type
the name of the method. You have to type
white at the sun. Off. Inside the car bracket, you can type your Addison. So the function is bublic. Everyone can access
that function. So if you type the
function as private, only inside the class
that can be accessed. Outside the class
we cannot access. So we are going to see
an example for Addison. You have to type in tA pul
ten and then in B qual 20. And then in C equal A plus B. So after that, we are going
to discuss about how to create the object inside
the main function. So you have to type the
class name that is methods, and then object name OB one. Using that object, we can call our function object
dot Addison off. You have to type Addison off. So before running the code, you have to change the
written type of the method. You have to change
the void to int. If you type void, it
won't return any value. So that's why you need to
change the written type. Also, you have to type
the CO, CO, C value. I will so the addison of two
values inside the Addison, you have to type C out. And then we are going to call the method of the class
using the object. You have to run the code
you can see the output 30. So the Addison of two values
ten and 20 will produce 30. So that's it, guys.
In today's class, we discussed about how to
create methods in class.
17. C++ Class 16 : Inheritance: Hello, everyone.
In today's class, we are going to discuss about
inheritance in C plus plus. So inheritance is nothing, but the child class will inherit the parent
class properties. So the properties can be the variables, methods,
or constructor. So we are going to see the
example for inheritance. So there are many
types in inheritance, but we are going to
discuss about two methods, single inheritance and
multiple inheritance. So first, we are going to discuss about
single inheritance. So you need to
include the heterpis, you have to include IO stream. So after that, you need
to create name space, so you have to type
namespace standard. After that, you need to
create parent class. You have to type class, and then you have to type
the parent class name. You have to type inheritance. So that's the parent glass. So after that, you need to put semicolon to the statement. So inside the parent class, you have to type the access specifier for the variables
and then methods. For that, first, we are going
to create bublic variables, how to type bublic colon, inside that Auto type
int A equal to ten. So after that, we are going
to create Bublic method. So first, we are creating
public variable. Now we are going to
create bublic method, to type void display of so
inside the display method, we are going to print the value. For that, you need
to type C out, so you need to type hello world. So after that, you need to
type SlasN for new line. So we just created Bublic variable and
then Bublic method. So after that, we are going
to create child class for that ENA to type the
syntax for the child class, first EA to type
the class keyword. And then you need to type
the name of the class child. So that's the child and then
you need to type colon. So that's the keyword
for inheritance. And then you need to
type the specifier. After that, you need to type the name of the parent class. That is inheritance. So this is how you can create
child class in inheritance. First, you need to
type the class name, and then you have to type colon. After that, you need to
type the access specifier. And then you need to type the
name of the parent class. That's the inheritance. So inside the child class, we are going to create
public variable, so you have to type
Bublic so after that, you need to type the
variable into B cult 20. So after that, we are going to discuss about how to create child class object for that you need to
type main function. So inside the main function, we are going to create object. For creating the object, you need to type the class name, that is the child class. And then you have to type the
object name that is OB two. So this is how you can create
object for the child class. So using the child class object, we can call the
parent class method and also the child
class variable. For that, you need
to type C out, see how to type O B two, that's the object, B, and then to type SlasN. So after that, we
are going to use the A from the parent class. How to type COO B two A, and then slashN so after that, we are going to call the parent class method using the object, how to type O B two dot display of So you need to change the return type
of the parent class method, you have to type into display. Then only the output
will be sewn. So we just discussed
a single inheritance. First, you need to
create the parent class. Inside that we are created Bublic variable and
then Bublic method. After that we are
created child class, you need to type colon, that's the specifier, and then you have to type the name
of the parent class. See how to type the access specifier Bubli then we are
created Bublic variable. After that, inside
the main function, we are just created object
for the child class. Using the object of
the child class, we can inherit the
parent class property. So how to run the code, you can see the output
20 that is nothing but the value of B and then ten, ten is nothing but the value of the parent class variable, A, and then parent class method. That's the output of method
of the parent class. That is display. So this is the single
inheritance in C plus plus. So after that, we are going to discuss about
multiple inheritance. So for multiple inheritance, you have to create
two parent class. First, we have created
the father class, I'm going to change
to father class, for example, and then I'm going to change
to mother class. So I'm going to
remove the specifier. After that, I'm going
to create child class. We just created two class, mother class, and
then father class. For that, you need
to type child class, and then you have to type
Colin that's the inheritance, and then you have to
type the specifier, and then you have to type
the first parent class name, that is the inheritance, and then you have to type
second parent class, that is the mother class. So you need to change that
you have to type comma. So this is how you can
use multiple inheritance. I just created two parent class for the single child class. Inside the child class, we are going to create a
variable in C equal to 30. After that, you need to create object for the child class. Using that object, we can
call two parent classes. So you can call the father class A variable and then
mother class B variable. And also the child
class variable. So you need to t the
access specifier. If you don't type the access
specifier for default, it will be considered
as private. For that, you need
to type public, and then you can
access the child class variable C. So first, we are created father class. That's the inheritance.
For example, we are created father class. Inside that we are created public variable and
then Bublic method. And then we are created
second parent class, that is mother class. So inside the mother,
we are just created one variable that
is Bublic B 420. And then we are
created child class. So child class will
inherit the properties of the first parent class and
then second parent class. Inside the child class, we just created Bublic C variable. And then we have created object. Using that object,
we are calling the parent class variables, A, B, and then child class
variables C. After that, you need to print the output. So I need to run the code so you can see the
output 20, ten, 30. So 30 is for the child class, and ten is for the parent class, and 20 is for the mother class. So that's a. In today's class, we are discussed
about how to create single inheritans and multiple
inheritans in C plus plus.