Skip to content

Commit 941683c

Browse files
authored
Update C_syntax.md
Added index of topics and changed layout for variables
1 parent 0b396d9 commit 941683c

File tree

1 file changed

+37
-14
lines changed

1 file changed

+37
-14
lines changed

LearningC/C_Language_Shorts/C_syntax.md

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,47 @@
33
C is a language with static strong typing,
44
This means that you cannot change a variable's type or size once you've declared it.\
55
You can only use variables you previously declared (or included from other files)
6+
### Index
7+
8+
> [Data Types](#variable-types)
9+
> > numbers \
10+
> > arrays \
11+
> > struct
12+
>
13+
> [Functions](#functions) \
14+
> [Conditional Statements](#conditional)
15+
> > if / then / else \
16+
> > switch / case
17+
>
18+
> [Loop Statements](#loop)
19+
> > while / do \
20+
> > for
21+
>
622
723
## Variable Types
824

925
### Numbers:
10-
- bool `#include <stdbool.h>`
11-
- true or false
12-
- char (signed/unsigned)
13-
- 8-bit = 1 byte
14-
- short (signed/unsigned)
15-
- 2-byte
16-
- integer (signed/unsigned)
17-
- 4 8 16 byte depending on os/cpu
18-
- long (signed/unsigned)
19-
- longer integer. if you need more you can use _long long_
20-
- float
21-
- real number
22-
- double
23-
- double precision real number
26+
> **bool** `#include <stdbool.h>`:
27+
> > true or false
28+
>
29+
> **char** (signed/unsigned):
30+
> > 8-bit = 1 byte
31+
>
32+
> **short** (signed/unsigned):
33+
> > 2-byte
34+
>
35+
> **integer** (signed/unsigned):
36+
> > 4 8 16 byte depending on os/cpu
37+
>
38+
> **long** (signed/unsigned):
39+
> > longer integer. if you need more you can use _long long_
40+
>
41+
> **float**:
42+
> > real number (8-bit?)
43+
>
44+
> **double**:
45+
> > double precision real number (16-bit?)
46+
>
2447
2548
> [!NOTE]
2649
> For **intergers** we specify the size explicitly when it matters:

0 commit comments

Comments
 (0)