Passiing Arrays To Udf Theory
Passiing Arrays To Udf Theory
In C, there are various general problems which requires passing more than one variable of the
same type to a function. For example, consider a function which sorts the 10 elements in
ascending order. Such a function requires 10 numbers to be passed as the actual parameters
from the main function. Here, instead of declaring 10 different numbers and then passing into
the function, we can declare and initialize an array and pass that into the function. This will
resolve all the complexity since the function will now work for any number of values.
Methods to declare a function that receives an array as an
argument
There are 3 ways to declare the function which is intended to receive an array as an
argument.
First way:
Second way:
Third way: