fork download
  1. #include<iostream>
  2. #include<stdio.h>
  3. using namespace std;
  4. void kal(int *a,int *b)
  5. {
  6. int *temp,i;
  7. temp=&i;
  8. *temp=*a;
  9. *a=*b;
  10. *b=*temp;
  11. }
  12. int main()
  13. {
  14. int i=5,j=10;
  15. kal(&i,&j);
  16. cout<<"I = "<<i<<" J = "<<j<<endl;
  17. return 0;
  18. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
I = 10 J = 5