Passing Array to Function in C
To reuse the array operation, we can create functions that receives array as argument. To pass array in function, we need to write the array name only in the function call.
There are 3 ways to declare function that receives array as argument.
First way:
Declaring blank subscript notation [] is the widely used technique.
Second way:
Optionally, we can define size in subscript notation [].
Third way:
You can also use the concept of pointer. In pointer chapter, we will learn about it.
C language passing array to function example
Output
minimum number is 3
No comments:
Post a Comment