An overview ...

Stephen J. Friedl friedl at mtndew.UUCP
Thu Jul 5 02:00:39 AEST 1990


> My solution: Photocopy the table on page 49 of K&R1 (Page 53 of K&R2
> is not as neat looking), and stick it on the wall next to your screen.

Alternatively, stick this in /usr/local/bin: I use this all the
time and this trivial little script has been handy time and time
again (it fits on one screen without having to use more!).

#------------------------------- cut here ---------------------------
# opchart.sh
#
# Description:
#
#	This simply prints a C operator precedence chart on
#	stdout.  It is taken right from K&R, page 49.

cat << 'EOF'

	  C operator precedence/associativity chart

Arity       Operator					Assoc
--------------------------------------------------------------
binary	  ()  []  ->  .					l -> r
unary	  !   ~   ++  --  -  (type)  *  &  sizeof	r -> l
binary	  *   /   %					l -> r
binary	  +   -						l -> r
binary	  <<  >>					l -> r
binary	  <   <=  >   >=				l -> r
binary	  ==  !=					l -> r
binary	  &						l -> r
binary	  ^						l -> r
binary	  |						l -> r
binary	  &&						l -> r
binary	  ||						l -> r
ternary	  ?:						r -> l
binary	  = += -= *= /= %= >>= <<= &= ^= |=		r -> l
binary	  ,						l -> r
--------------------------------------------------------------
						From K&R, p 49
EOF
#------------------------------- cut here ---------------------------
-- 
Stephen J. Friedl, KA8CMY / Software Consultant / Tustin, CA / 3B2-kind-of-guy
+1 714 544 6561  / friedl at mtndew.Tustin.CA.US  / {uunet,attmail}!mtndew!friedl

"Show me a good loser and I'll show you a loser" - Roger Penske



More information about the Comp.lang.c mailing list