bit_ops.c

Cマスター

Explorer

C
初級10
中級10
上級10
エキスパート5
マスター5
function_ptr.c
linked_list.c
bit_ops.c
signal.c
mem_pool.c
C++40
C#40
Dart40
Go40
Java40
JavaScript40
Kotlin40
Objective-C40
Perl40
PHP40
Python40
R40
Ruby40
Rust40
Shell40
Swift40
TypeScript40
bit_ops.c
Click to focus
1
2
3
4
5
6
7
8
9
10
11
#define SET_BIT(x, n) ((x) |= (1 << (n)))
#define CLR_BIT(x, n) ((x) &= ~(1 << (n)))
#define GET_BIT(x, n) (((x) >> (n)) & 1)
uint32_t reverse(uint32_t n) {
   uint32_t r = 0;
   for (int i = 0; i < 32; i++) {
       r = (r << 1) | (n & 1);
       n >>= 1;
   }
   return r;
}
0WPM0%0:000/276(0%)|Ln 1, Col 1
UTF-8C

関連する練習問題