It's a bit more common in C when swapping pointers, since it can help you ensure that there's only one pointer to a given structure at any time, and it can simplify memory management in certain cases by letting you repurpose an existing allocation.
No comments yet.