Skip to content

Commit 9dd0a09

Browse files
authored
Update C_syntax.md
More data types
1 parent 0d3ace9 commit 9dd0a09

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

LearningC/C_Language_Shorts/C_syntax.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ You can only use variables you previously declared (or included from other files
77
## Variable Types
88

99
### Numbers:
10-
- bool
10+
- bool `#include <stdbool.h>`
1111
- true or false
1212
- char (signed/unsigned)
1313
- 8-bit = 1 byte
@@ -22,9 +22,20 @@ You can only use variables you previously declared (or included from other files
2222
- double
2323
- double precision real number
2424

25-
For **intergers** we sprcify the size explicitly when it matters:
26-
- uint8_t : unsigned 8 bit
27-
- int32_t : signed 32 bit
25+
> [!NOTE]
26+
> For **intergers** we specify the size explicitly when it matters:
27+
> - uint8_t : unsigned 8 bit
28+
> - int32_t : signed 32 bit
29+
30+
### Arrays
31+
Records of homogenous data. Technically it's like a **list**\
32+
The classic example would be ** char* argv[] **\
33+
which holds the list of parameters/arguments passed to a program,
34+
### Struct
35+
When we need several variables to describe an entitiy. we use **struct** (records of heterogenous data)
36+
37+
### Unions
38+
Sometimes we need alternatives. A **union** could consist of a number and the text "Not Defined"
2839

2940
### Type defined
3041
You can define your own types with **_typedef_**

0 commit comments

Comments
 (0)