This source code is switching on a string in C. How does it do that?

Viewed 10228

I'm reading through some emulator code and I've countered something truly odd:

switch (reg){
    case 'eax':
    /* and so on*/
}

How is this possible? I thought you could only switch on integral types. Is there some macro trickery going on?

4 Answers
Related