Bit Masking Question

Joe_W_Wright at cup.portal.com Joe_W_Wright at cup.portal.com
Tue Jun 25 04:09:57 AEST 1991


All characters will fit your three stated cases, therefore the printf()
is not even reachable.  Try this.

#define RMASK 0xc0
#define FMASK 0x80

	switch (c & RMASK) {
		case RMASK : do1(); break;
		case FMASK : do2(); break;
		default    : do3();
	}

Should work everywhere.
Joe Wright



More information about the Comp.lang.c mailing list