Monday, July 27, 2009

I am having trouble writeing a function that swaps two integer variables using pointers.?

The function takes two integer pointers as arguments.





"C++"

I am having trouble writeing a function that swaps two integer variables using pointers.?
void swap(int* a, int* b)


{


int temp = *a;


*a = *b;


* b = temp;


}


No comments:

Post a Comment