programplug Logo

C Call By Reference

original value is modified

Passing arguments to a function copies the address of an argument into the formal parameter.In call by reference, original value is changed or modified because we pass address(reference).So actual and formal arguments shares the same address space.

void incre(int  *v)
    *v = *v+1;
int main()
     int n=10;
     printf("Value of number is: %d", n);
     return 0;

Output :
Value of number is: 11

Example : Swapping numbers using Function Call by reference

void swap(int *a, int *b)
 int temp;
void main() 
 int a=400, b=200;   
 printf("\n Value of a: %d",a);
 printf("\n Value of b: %d",b);  

Value of a: 200
Value of b: 400

Our Services

Developing Cheapest Websites
Offer Digital Marketing
Provide College Projects
Attractive Website Developing
Summer Training,Industrial Training

Contact Us

Dehradun Uttarakhand India
Designed By : Mridul Gupta

Other Link

About Us

Contact Us


Privacy Policy