> For the complete documentation index, see [llms.txt](https://amriths-harijayanthan.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://amriths-harijayanthan.gitbook.io/notes/c-programming.md).

# C programming

C programming short notes

## Precedence and Associativiy&#x20;

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* &#x20;

{% embed url="<https://cplusplus.com/reference/cstdio/printf/>" %}

## Type-specifier&#x20;

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
