Not necessarily. Here's another version of the swap function:Originally posted by The Dog
whenever you need to do a swap, you'll need a temporary variable.
Code:void swap(int* a, int* b) { *a^=*b^=*a^=*b; }
Not necessarily. Here's another version of the swap function:Originally posted by The Dog
whenever you need to do a swap, you'll need a temporary variable.
Code:void swap(int* a, int* b) { *a^=*b^=*a^=*b; }
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]