Hi guys.
Welcome back.
OK.
Indecision We are going to learn how to pass an array to functions similar to passing variables.
Your function.
OK so does the header file which you discussed in the illustration.
OK.
And this one is a function prototype.
OK.
Before defining a function in a program.
So it's a good practice to declare this function prototype in order to instruct the comeback function
will be used later in the program.
OK.
And now this is a function definition of this display function.
So what I'm going to do here is I'll just get this parameters.
Just get these parameters from the main function wherever it is getting called and I'll just print that
value in the second so that's.
OK.
Just dig the value and from the value.
OK so no this is the array declaration engineering part which we already discussed earlier.
OK.
So now what I would do is I'm going to call this function which is a display which is here.
I'm going to call this function of these two parameters array parameters.
OK.
So are you off and passing an idea of three and passing.
OK so are you have two means as I told you earlier area of 0 which contains the first element which
is fine array of one will contain the second element just an array of two will contain the third element
which is 15 which means I am passing 15 0 here.
Okay so similarly array of three will convince a value of twenty seven when passing from here are a
value I'm passing fifteen then don't.
And please note when you're passing the parameter this is the proper syntax the variable anyhow to mention
which element you're going to pass okay.
That idea of why adding value of 1 or 2 or 3 whatever it is.
Okay so but is the format how you need to pass the array values to function.
Okay.
So now we will execute this program and see what happens okay.
See.
Okay.
As I told you earlier we have zero contained fire 3 of 1 contained an array of 2 contains 15 which means
we have to condense 15 and the scene was printer we just finished.
Okay so similarly area 3 holds a value of 20.
Then don't do a spot postie at age 2.
And this was printed strongly so.
So this is how we can parse and added value to a function so well making a function called In Our pregnancy
program.
Okay.
Thanks for watching.
I'll get you guys and then another video.