Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Interesting but not understandable.
For someone like me teetering the edge of beginner, could you point to a good starting resource for what is being discussed here? Bitwise operators are way above me
Thanks for the link, @hobovsky!
I'll give it a read :)
Except this is UB: https://stackoverflow.com/a/28783339/1756361
This is the approach I took too, except I moved mine into a macro to keep it a little more readable and re-usable:
I had to work this out in a Base Mode calculator to figure it out. Placeholders be damned; this is how I'm swapping values for now on
I needed your explanation (and paper/pen) to understand it. Thank you.
I only try to explain the swap mechanism because it took time for me to understand, so I made the post because newbies could understand. Sorry I am a teacher.
But you are right, no checking of the parameters is always a bad thing.
Clever it might be. But you better be sure that
p1
andp2
can never point to the same memory location before even thinking about this.This comment is hidden because it contains spoiler information about the solution