ppdfviewer, basic, bits and string view
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
|
||||
unsigned char flags = 0b0000010;
|
||||
|
||||
unsigned char FLAG_A = 1u << 0;
|
||||
unsigned char FLAG_B = 1u << 1;
|
||||
|
||||
printf("El FLAG_A es: %08b\n", FLAG_A);
|
||||
printf("El FLAG_B es: %08b\n", FLAG_B);
|
||||
|
||||
// encender ambos.
|
||||
flags = (FLAG_A | FLAG_B);
|
||||
|
||||
if (flags & (FLAG_A)) {
|
||||
printf("El flag A esta encendido\n");
|
||||
}
|
||||
|
||||
if (flags & (FLAG_B)) {
|
||||
printf("El flag B esta encendido\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user