1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
typedef unsigned char uchar;
uchar _set_bit(uchar ch, int bit_idx, uchar value) {
assert(value == 0 || value == 1);
}
int main(int argc, char* argv[]) {
assert( _set_bit(0b00000000, 1, 1) == 0b01000000 );
// ^
return EXIT_SUCCESS;
}
/* vim: set tabstop=4 shiftwidth=4 fenc=utf-8 noet: */
|
© Copyright 2017 Alexander J. Quinn This content is protected and may not be shared, uploaded, or distributed.