Forecasts in C++ expansions in C++, we are going to discuss in this lecture.
So without further ado, let's start the session.
So first of all, I'm explaining you some basics about the model and programming concept.
So what is actually meant by model and program?
Suppose we do have a large program and we want to do like many actions in that particular program.
Suppose it's an employee management system, and a lot of things can happen in an employee management
system, like adding the employee, leaving the employee, updating their salary information, right?
So these kinds of things can be done as a large single program without like having any kind of modularity
in that, which means that if we construct a program in such a way that everything is done step by step
without any action, it is very difficult to manage such kind of programs.
So this cost bringing up a new programming approach, and that programming approach is far more tailored
program.
So what is the basic idea of more like program?
So that's what we are going to see in the first section of this lecture.
So in case of model, our program, a large program, we are dividing into small sub programs.
And if we want to solve that particular large problem we are facing or we are trying to address using
our program.
We are trying to create smaller units of that particular program and try to solve that problem individually
by solving each and every small units.
So what we are doing, we are dividing a larger program into independent modules and in these units
are completely independent of each other so that they can function independently.
So this concept is quite modular programming.
Now, why does that advantage of more lap programming that is an important topic you should be aware
of.
First of all.
In C++, it's a great programming language which supports modular programming.
And by supporting the programming model, that programming approach as C++ program can be.
Smaller compared to programs in other programming language like Boscalid, Fortran, et cetera, which
do not have this much more clarity.
Then another thing is like we can avoid duplicating the code supposed to be right, therefore, for
doing something in C++ and without knowing that that guard is already there.
If I'm rewriting it, it's like you dig in and again and in my program, then there will be a lot of
duplication in my codes.
Right?
So that kind of duplication can be avoided.
Then next thing is, if we have a modularity in our programming, that code can be reused again and
again.
So whenever if I want to, I have a modular approach card.
Some it's a function.
We will be calling the modularity in the name that is called function in a minute that we will be introducing.
For now, you just imagine we have a section in a program which computes the sum of two or three numbers.
And if I want to compute the sum of numbers, I don't want to write the code for executing something
again and again.
But instead, I was just call this function again and again.
Then that will execute and I can do the same.
So that's one advantage of using functions or more like programming approach, and these functions can
be called repeatedly.
So what we use to achieve modularity in C++ programming, actually that discard functions.
So, Fonctionne, help us to get deep more, that'd be in a particular program.
Then using a set of functions, we can be fired and set to functions for different, different users,
and using these set of functions, we can create a library and these libraries can be reused to get
the desired things that.
OK, so let's dive in deep, then you will get more on this topic.
So in C++ beside the box office function.
So these things, when we are creating a C++ program using modularity approach, we will be using a
lot of functions in the C++ program.
And if we are creating a function, then these are the important things we have to use.
So our function will be consisting of a function brought on by function, definition, function, gui,
actual and formal arguments and a written statement.
Now we are going to see each one of these in detail.
So here I am, giving you an example for prototyping and functioning.
So while I start writing in program after my hash includes statements and are.
Ash, include had that fire.
After that, I will be having a lot of leg declarations, right, lot of including including statements
or pre-processed that actives in my program and along with that, if I'm creating a function, if I'm
creating planning to create a function in my program, I need to make sure that I declare a prototype
why I start the program.
So our prototype will be mainly looking like this.
It will be showing it better by.
Return type.
Then we'll be showing why does the name of the function benefit of showing that arguments inside the
function?
What are the animals that particular function can accept?
And then it ends with that semicolon it.
Suppose I am planning to create that function, which acts to an ambush.
Began floating by numbers.
Then, before making the clear definition of the function, I need to get the prototype of the function,
I need to write a prototype of the function in the stack so that the prototype will say to the compiler
that there would be a chance that this particular function will be introduced or this will be a function
in the program, which will be actually having a return type of law.
Actually, that is given by the function will be a floating point number and the name of the function
is some, and it will accept two numbers to do the operation.
It will be both will be floating point operations and one more optional thing is like why are you supplying
the prototype?
And you declare the argument list, like, what are the variables that function?
Except you can either merely define its type, followed by a comma or another ways you can give that
variable name which you are planning to use inside your function.
This concept will be also be clear for you while we look into a samba program.
So let's move to the next part of that function.