Recall Pointer Parameters
// Swap contents of variables pointed to by x and y
void swap (int * x, int * y)
{int tmp; tmp= *x; *x= *y; *y= tmp;}
Example of a call on procedure swap:
int j= 17;
int k= 24;
swap(&j, &k);
Previous slide
Next slide
Back to first slide
View graphic version