We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
#include<stdio.h>voidupdate(int*a,int*b){*a+=*b;// Because here *a = *a+*b*b=abs(*a-2*(*b));/* Because here *b = ((*a+*b) - 2*(*b))*/}intmain(){inta,b;int*pa=&a,*pb=&b;scanf("%d %d",&a,&b);update(pa,pb);//Here we are passing the address of a & bprintf("%d\n%d",a,b);return0;}
Pointers in C
You are viewing a single comment's thread. Return to all comments →