/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <stdio.h>

int cat[256] = { 0 };

#define A_OR_B 1
#define X_OR_AST 2
#define OTHER 3

void init()
{
   int i;
   cat['a'] = A_OR_B;
   cat['b'] = A_OR_B;
   cat['x'] = X_OR_AST;
   cat['*'] = X_OR_AST;
}

int main()
{
    unsigned char c;
    init();
    c = 'x';
    if(cat[c] == A_OR_B)
    {
        printf("c er enten 'a' eller 'b'\n");
    }
    else if(cat[c] == X_OR_AST)
    {
        printf("c er enten 'x' eller '*'\n");
    }
    else
    {
        printf("c er noget andet\n");
    }
    return 0;
}
