Call by reference in C

Call by reference method of passing arguments to a function that the address of an argument into the formal parameter.

Source code :

#include <stdio.h>


int myFunc(int *,int *);


int main()
{
	int a=10,b=75;
	myFunc(&a,&b);
	return 0;
}

int myFunc(int *a,int *b)
{
	printf("The sum is %d\n", *a+*b);
	return 0;
}

Output :

The sum is 85

Output :


                

Comments :