\newpage
\subsubsection{Operators}
The list of operators in \lC\ is similar to the one of \texttt{Java}, etc.
In Table \ref{tab:c-operators}, you can see an overview of the operators, sorted by precedence in descending order.
You may notice that the \verb|&| and \verb|*| operators appear twice. The higher precedence occurrence is the address operator and dereference, respectively,
and the lower precedence is \texttt{bitwise and} and \texttt{multiplication}, respectively.

Additionally, \verb|+| and \verb|-| also appear twice, the higher precedence one being a unary plus or minus, respectively, which is used to denote positive or negative numbers,
and it can also be used to do a sort-of assertion that we have an arithmetic type using the preprocessor macro
\mint{c}|#define CHECK_ARITHMETIC(x) (+(x))|
which will cause a compiler error if \texttt{x} is for example a pointer.
Of course, the lower precedence \verb|+| and \verb|-| is addition and subtraction, respectively.

Very low precedence belongs to boolean operators \verb|&&| and \texttt{||}, as well as the ternary operator and assignment operators.
\begin{table}[h!]
    \begin{tables}{ll}{Operator                                  & Associativity}
              \texttt{() [] -> .}                            & Left-to-right                \\
              \verb|! ~ ++ -- + - * & (type) sizeof|         & Right-to-left  \\
              \verb|* / %|                                   & Left-to-right  \\
              \verb|+ -|                                     & Left-to-right  \\
              \verb|<< >>|                                   & Left-to-right  \\
              \verb|< <= >= >|                               & Left-to-right  \\
              \verb|== !=|                                   & Left-to-right  \\
              \verb|&| (logical and)                         & Left-to-right  \\
              \verb|^| (logical xor)                         & Left-to-right  \\
              \texttt{|} (logical or)                        & Left-to-right                \\
              \verb|&&| (boolean and)                        & Left-to-right  \\
              \texttt{||} (boolean or)                       & Left-to-right                \\
              \texttt{? :} (ternary)                         & Right-to-left                \\
              \verb|= += -= *= /= %= &= ^=||\verb|= <<= >>=| & Right-to-left  \\
              \verb|,|                                       & Left-to-right  \\
    \end{tables}
    \caption{\lC\ operators ordered in descending order by precedence}
    \label{tab:c-operators}
\end{table}

In an expression like \texttt{x = (expr1, expr2)}
the first expression is evaluated, its result is discarded, the second expression is executed and its result is returned.
It is also possible to chain them, i.e. to use multiple without parenthesis, the last expression's value is ultimately returned.
Of note is that the expressions have to be encased in parenthesis.

\shade{blue}{Associativity} 
\begin{itemize}
    \item Left-to-right: $A + B + C \mapsto (A + B) + C$
    \item Right-to-left: \texttt{A += B += C} $\mapsto$ \texttt{A += (B += C)}
\end{itemize}

As it should be, boolean and, as well as boolean or, support early termination.

The ternary operator works as in other programming languages \verb|result = expr ? res_true : res_false;|

As previously touched on, every statement is also an expression, i.e. the following works
\mint{c}|printf("%s", x = foo(y)); // prints output of foo(y) and x has that value|

Pre-increment (\texttt{++i}, new value returned) and post-increment (\texttt{i++}, old value returned) are also supported by \lC.

\lC\ has an \texttt{assert} statement, but do not use it for error handling. The basic syntax is \texttt{assert( expr );}
