3.0 - Passing and Returing An Array To - From A Function
3.0 - Passing and Returing An Array To - From A Function
Thanks to and Resource from : Sumitabha Das, “Computer Fundamentals and C Programming”, 1st Edition, McGraw Hill, 2018.
Unit I : Contents
1. Pointers- Introduction
2. Pointers and 1D array
3. Passing an array to a function
4. Returning an array from function
5. Pointers and 2D array
6. NULL pointers
7. Array of pointers
8. Pointer-to-pointer
9. Generic pointers
10.Dangling Pointer
11.Using Pointers for string manipulation
12.Two dimensional array of strings
13.Array of pointers to strings.
2.0 _ Passing and Returing an array
04/28/2021 2
to_from a function
Passing an array to a function
• We can pass an individual elements or entire array to
a function as an argument.
• To pass an entire array to a function, only the name
of the array is passed as an argument.
• When address is passed as an argument, the
function definition should have an array or a pointer
as a parameter to receive the passed address.
• When an array is passed to a function, the changes
made by the function affect the original array.