main.c: basic enum
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
commit
9f1aba8dd8
1 changed files with 34 additions and 0 deletions
34
main.c
Normal file
34
main.c
Normal file
|
@ -0,0 +1,34 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
enum
|
||||
DNA_PROTEINS
|
||||
{
|
||||
DNA_PROTIEN_A = 0x01,
|
||||
DNA_PROTIEN_T = 0x02,
|
||||
DNA_PROTIEN_G = 0x04,
|
||||
DNA_PROTIEN_C = 0x08,
|
||||
};
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
signed char c;
|
||||
short int i;
|
||||
|
||||
printf("sizeof(c) %d\n", sizeof(c));
|
||||
printf("sizeof(i) %d\n", sizeof(i));
|
||||
|
||||
|
||||
printf("c: %b || %d\n", c, c);
|
||||
printf("A: %b\n", DNA_PROTIEN_A);
|
||||
printf("T: %b\n", DNA_PROTIEN_T);
|
||||
printf("G: %b\n", DNA_PROTIEN_G);
|
||||
printf("C: %b\n", DNA_PROTIEN_C);
|
||||
|
||||
c |= DNA_PROTIEN_A;
|
||||
printf("c: %b || %d\n", c, c);
|
||||
c |= DNA_PROTIEN_G;
|
||||
printf("c: %b || %d\n", c, c);
|
||||
}
|
Loading…
Add table
Reference in a new issue