This document is not intended to be a primer on the C programming language. It only gives you the essential information you need to complete your programming assignments.
This document is not intended to be a primer on the C programming language. It only gives you the essential information you need to complete your programming assignments.
We will focus on common errors, caveats and important concepts that might ease your cognitive overhead when you program in C. We will also recommend some tools that help you speed up your development and debugging.
## C Compilation Process
## C Compilation Process
Unlike other interpreted programming languages, we use compilers to compile C written programs.
Unlike other interpreted programming languages, we use compilers to compile C written programs.
...
@@ -77,6 +79,8 @@ We will use **UB** and **undefined behaviours** interchangeably in the later sec
...
@@ -77,6 +79,8 @@ We will use **UB** and **undefined behaviours** interchangeably in the later sec
### Frequent Undefined Behaviours
### Frequent Undefined Behaviours
Here are some common undefined behaviours you may or may not have already encountered before:
#### Signed Overflow
#### Signed Overflow
```c
```c
...
@@ -192,3 +196,5 @@ int main() {
...
@@ -192,3 +196,5 @@ int main() {
```
```
This list goes on, you can find more information about undefined behaviours in this [thesis](https://solidsands.com/wp-content/uploads/Master_Thesis_Vasileios_GemistosFinal.pdf) and in the [C99 Standard](https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf)
This list goes on, you can find more information about undefined behaviours in this [thesis](https://solidsands.com/wp-content/uploads/Master_Thesis_Vasileios_GemistosFinal.pdf) and in the [C99 Standard](https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf)