Answers for "pass the pointer to the function"

C
1

pass the pointer to the function

#include<stdio.h>

//pass the simple pointer to the function

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

int main()
{
  	int a = 10;
  	int b = 20;
  	swap(&a,&b);
  	printf("A is %d and B is %d\n", a , b);
  	return 0;
}
Posted by: Guest on March-21-2022

Code answers related to "pass the pointer to the function"

Code answers related to "C"

Browse Popular Code Answers by Language