C programming
C programming short notes
Precedence and Associativiy
Use PUMA' S REBL TAC. ( spell "REBL" as if "REBEL").
(Note: all operators with associativity not specified is left to right).
P - Primary
U - Unary
M - Multiplicative
A - Additive
S- Shift
R- Relational
E- Equality
B- BitWise ( & > ^ > |)
L- Logical ( logical && > logical ||)
and the last three operators are
T- Ternary
A- Assignment
C- Comma
If you need a shortcut for Assosiativity then "AUTo rides in the right side", meaning Assignment, Unary and Ternary operators are Right to Left, O is added for completion)
printf format specifiers
Type-specifier
volatile , const , restrict(C99)
Function recursion
a function that calls itself : example fib(n) = f(n-1) + f(n-2)
remeber space-time tradeoff , thabove algorith is not saving time but space in memory(ram)
Struct
Bitfield
Union
Last updated