summaryrefslogtreecommitdiffstats
path: root/test_ascii_enum.c
blob: 55a572457fd48d93347a176c9c2c6a899b10c263 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <string.h>

enum { FIRST, SECOND, THIRD };

char list[] = "abcABC123(){}";

void main(void) {
  int i;
  printf("EOF: 0x%X\n", EOF);
  printf("FIRST: 0x%X\n", FIRST);
  printf("SECOND: 0x%X\n", SECOND);
  printf("THIRD: 0x%X\n", THIRD);
  for(i = 0; i <= strlen(list); i++)
    printf("list[%d]: %c = 0x%X\n", i, list[i], list[i]);

  printf("Does list[%d] == FIRST? %s!\n", (int)strlen(list), 
    list[strlen(list)] == FIRST ? "YES" : "NO");
}