precedences of C operators

Mike Thompson mike at iotek.UUCP
Wed Sep 20 01:42:04 AEST 1989


	Several years ago when I was taking a compiler course I took a
    BNF definition of the C syntax and derived the following
    precedence table. This table seems to jive with the K&R bible.

	Operator				Associativity
	======================================= =============
	() [] -> .				left to right
	! ~ ++ -- - (type) * & sizeof		right to left
	* / %					left to right
	+ -					left to right
	<< >>					left to right
	< <= > >=				left to right
	== !=					left to right
	&					left to right
	^					left to right
	|					left to right
	&&					left to right
	||					left to right
	?:					right to left
	= += -= *= /= %= <<= >>= &= ^= |=	right to left
	,					left to right
-- 
<<<<<<******>>>>>>
Michael A. Thompson, Iotek Inc, |*| E-Mail: mike at iotek.uucp	|*| Have
1127 Barrington St., Suite 100, |*| Fax:    (902)420-0674	|*|   a Good
Halifax, N.S., B3H 2P8, Canada  |*| Phone:  (902)420-1890	|*|     Day :-)



More information about the Comp.lang.c mailing list