Home » C Programs » Passing Array to Function in C

Passing Array to Function in C

In c, passing an int pointer to a function. A function is a set of statements that work together to complete a mission. A pointer is a variable whose value is the address of another variable that is the memory location’s direct address.

Pointer in C Program

In C, a pointer is a variable that keeps track of the address of another variable. A pointer can also be used to refer to the function of another pointer. A pointer can be increased or decreased, pointing to the next or previous memory location. The purpose of a pointer is to save memory and speed up the execution process. Pointer method to execute the passing array to function in c 

Return Statement in C

A return statement instructs the program to exit the current function and resume execution at the point in the code immediately following the function’s call. Return statements allow a function to specify a return value that will be passed back to the code that called the function in many languages.

Function Definition in C

A function is a collection of statements that work together to complete a task. The name, return type, and parameters of a function are all specified in a function declaration. The body of the function is defined by a function definition. The C standard library includes a number of built-in functions that you can use in your program. 

Passing Array to Function in C

//Passing Array to Function in C
int func(int a, int b) 
printf("\n\n a = %d \n", a);
printf("\n\n b = %d \n", b);
int main()
int(*fptr)(int , int);
fptr = func;
return 0;


a = 5

b = 6

a = 7

b = 8