You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: LearningC/C_Language_Shorts/C_syntax.md
+27-4Lines changed: 27 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,7 @@ You can only use variables you previously declared (or included from other files
23
23
## Variable Types
24
24
25
25
### Numbers:
26
+
> [!NOTE]
26
27
> **bool**`#include <stdbool.h>`:
27
28
> > true or false
28
29
>
@@ -45,15 +46,17 @@ You can only use variables you previously declared (or included from other files
45
46
> > double precision real number (16-bit?)
46
47
>
47
48
48
-
> [!NOTE]
49
-
> For **intergers** we specify the size explicitly when it matters:
49
+
> [!TIP]
50
+
> For **intergers** we specify the size explicitly when it matters`#include <stdint.h>`:
50
51
> - uint8_t : unsigned 8 bit
51
52
> - int32_t : signed 32 bit
53
+
>
52
54
53
55
### Arrays
54
56
Records of homogenous data. Technically it's like a **list**\
55
-
The classic example would be ** char* argv[]**\
56
-
which holds the list of parameters/arguments passed to a program,
57
+
The classic example would be **char\* argv[]**\
58
+
which holds the list of parameters/arguments passed to a program.
59
+
57
60
### Struct
58
61
When we need several variables to describe an entitiy. we use **struct** (records of heterogenous data)
59
62
@@ -62,6 +65,10 @@ Sometimes we need alternatives. A **union** could consist of a number and the te
62
65
63
66
### Type defined
64
67
You can define your own types with **_typedef_**
68
+
```
69
+
typedef uint16_t banana;//0-65535
70
+
banaba bigNum = 1329:
71
+
```
65
72
66
73
### Other/Any
67
74
void: no variable/value
@@ -84,6 +91,22 @@ If you want to know how many bits they are, you can call the _sizeof() function_
84
91
</details>
85
92
86
93
## Functions
94
+
Functions have a **prototype** which defines parameters and return value.
95
+
When you want to create a function you put the prototype at the beginning of the [source file](C_Files.md#source) or in the [header file](C_Files.md#header)
0 commit comments