Why in this code, an asterik has come after int ?

void swap( int* a, int* b) { int temp = *a; *a = *b; * b = temp; }


4/17/2019 8:33:26 AM

Aryaveer Singh Rawat

2 Answers

New Answer


Review the pointers section of the c course. https://www.sololearn.com/learn/C/2933/?ref=app


a and b are pointers to integers which means that they are varaiables that contain the addresses of integer variables.