vendredi 8 janvier 2016

enum comparison in if statement never true in c

I have an enum along the lines of

enum day
{
    Monday = 'M',
    Tuesday = 'T',
    Wednesday = 'W'
}

and a 2d array of days later used in an if statement like this:

if ( theArray[0][0] == Monday )
    { foo statements; }

but that condition never evaluates to true even if every element of the array is Monday, any ideas why?

Aucun commentaire:

Enregistrer un commentaire