BY CHAITANYA SINGH | FILED UNDER: C-PROGRAMMING
Just like variables, array can also be passed to a function as an argument . In this guide, we will learn how to pass the array to a function using call by value and call by reference methods.
To understand this guide, you should have the knowledge of following C Programming topics:
As we already know in this type of function call, the actual parameter is copied to the formal parameters.
#include <stdio.h> void disp( char ch) { printf("%c ", ch); } int main() { char arr[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'}; for (int x=0; x<10; x++) { /* I’m passing each element one by one using subscript*/ disp (arr[x]); } return 0;