Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bit manipulation
#1
Bit manipulation involves performing operations at the bit level.

// Setting a bit using bitwise OR (|)
int num = 5; // Binary: 0101
int mask = 1; // Binary: 0001
int result = num | mask; // Binary: 0101 | 0001 = 0101
printf("%d\n", result); // Output: 5
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)