toggle bits in a variable
C / C++ / MFC
3
Posts
3
Posters
0
Views
1
Watching
-
how can we just toggle all the bits in a variable using the shortest code? Can anybody give me a sample code?
-
how can we just toggle all the bits in a variable using the shortest code? Can anybody give me a sample code?
By using the
~operator:
int var1 = 0;
int var2 = ~var1;Cédric Moonen Software developer
Charting control [v3.0] OpenGL game tutorial in C++ -
how can we just toggle all the bits in a variable using the shortest code? Can anybody give me a sample code?
See reply under QA - don't post to multiple forums, it just duplicates work and annoys people.
Did you know: That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.