@@ -10,4 +10,44 @@ A full compilation in C is depicted in the following figure:
...
@@ -10,4 +10,44 @@ A full compilation in C is depicted in the following figure:


A detailed explanation can be found [here](https://www.scaler.com/topics/c/compilation-process-in-c/)
A detailed explanation can be found [here](https://www.scaler.com/topics/c/compilation-process-in-c/).
## C Macros
You often see C preprocessor macros defined to create "small functions"
But they **aren't actual functions**, it just changes the **text** of the program.
`#include` just copies that file into the current file and replace the arguments.
Example:
```c
#define twox(x) (x + x)
// twox(3); => (3 + 3);
// this could lead to unexpected behaviours
// int y = 2;
// int z = twox(y++); => z = (y++ + y++); z will atucally be 5
```
## Specific Sized Numbers
C only guarantees minimum and relative size of "int", "short" etc...
The integer data types range in size from at least 8 bits to at least 32 bits. The C99 standard extends this range to include integer sizes of at least 64 bits.
The types are ordered by the width, guaranteeing that _wider_ types are at least as large as _narrower_ types. E.g. `long long int` can represents all values that a `long int` can represent.
If you need to have an exact width of something, you can use the `{u|}int{#}_t` type to specify:
- signed or unsigned
- number of bits
For example:
-`uint8_t` is an unsigned 8-bit integer
-`int64_t` is an signed 64-bit integer
All theses types are defined in the header file `stdint.h` instead of in the language itself.