From c4f541dc92ae149947a49a885292d8ad7ead7aa6 Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Sun, 1 Sep 2013 13:17:26 -0500 Subject: Add order of evaluation table to C. --- c.html.markdown | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/c.html.markdown b/c.html.markdown index ea047ea0..fd0b7964 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -593,6 +593,31 @@ typedef void (*my_fnp_type)(char *); // ... // my_fnp_type f; + +/////////////////////////////////////// +// Order of Evaluation +/////////////////////////////////////// + +//---------------------------------------------------// +// Operators | 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 // +//---------------------------------------------------// + ``` ## Further Reading -- cgit v1.2.3