How to use enum with ASCII values in C

1 Answer

0 votes
#include <stdio.h>

typedef enum { 
    a = 97, b, c, d
} Exampel;

int main(void) {
    Exampel ex = c;
    
    printf("%c", ex);
}



/*
run:

c

*/

 



answered Jan 28, 2023 by avibootz

Related questions

1 answer 156 views
156 views asked May 14, 2024 by avibootz
1 answer 73 views
73 views asked Nov 18, 2024 by avibootz
1 answer 147 views
1 answer 163 views
163 views asked Aug 28, 2017 by avibootz
1 answer 163 views
...