Skip to content

Commit ef6e047

Browse files
authored
Update C_syntax.md
organisation of int
1 parent 5ffd697 commit ef6e047

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

LearningC/C_Language_Shorts/C_syntax.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,23 @@ You can only use variables you previously declared (or included from other files
5252
> - int32_t : signed 32 bit
5353
>
5454
55+
<details>
56+
<summary> More on type "int" </summary>
57+
Check man stdint.h
58+
59+
Integers can be prefixed with _unsigned_
60+
- As an example take _char_ which is 8 bit long, 2^8 = 256 values
61+
- char is from -128 to 127 [ -(2^8) /2 ; ((2^8) /2)-1 ]
62+
- unsigned char from 0 to 255 [ 0 ; (2^8)-1 ]
63+
64+
Integers can be:
65+
- long (l)
66+
- unsigned long (ul)
67+
- long long (ll)
68+
- unsigned long long (ull)
69+
If you want to know how many bits they are, you can call the _sizeof() function_
70+
</details>
71+
5572
### Arrays
5673
Records of homogenous data. Technically it's like a **list**\
5774
The classic example would be **char\* argv[]**\
@@ -73,23 +90,6 @@ banaba bigNum = 1329:
7390
### Other/Any
7491
void: no variable/value
7592

76-
<details>
77-
<summary> More on type "int" </summary>
78-
Check man stdint.h
79-
80-
Integers can be prefixed with _unsigned_
81-
- As an example take _char_ which is 8 bit long, 2^8 = 256 values
82-
- char is from -128 to 127 [ -(2^8) /2 ; ((2^8) /2)-1 ]
83-
- unsigned char from 0 to 255 [ 0 ; (2^8)-1 ]
84-
85-
Integers can be:
86-
- long (l)
87-
- unsigned long (ul)
88-
- long long (ll)
89-
- unsigned long long (ull)
90-
If you want to know how many bits they are, you can call the _sizeof() function_
91-
</details>
92-
9393
## Functions
9494
Functions have a **prototype** which defines parameters and return value.
9595
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

Comments
 (0)