Arrays and Functions
Let's get into the details of passing an array to a function.
We'll cover the following...
We'll cover the following...
Passing an array to a function
To pass an array to a function, we just have to specify the array type, followed by an array name and square brackets in the function parameters.
Example program
Let’s write a program that takes an array in its parameters.
In the program, we will traverse the array elements. If the value of an array element is less than 50, we will update the value at that index to -1.
Press the RUN button and see the output!
In the code above: ...