Answers for "pass address to function c++"

C++
0

pass address to function c++

#include <stdio.h>

void swapnum(int &i, int &j) {
  int temp = i;
  i = j;
  j = temp;
}

int main(void) {
  int a = 10;
  int b = 20;

  swapnum(a, b);
  printf("A is %d and B is %d\n", a, b);
  return 0;
}
Posted by: Guest on April-29-2022

Code answers related to "pass address to function c++"

Browse Popular Code Answers by Language