sync: 2026-11-09 16:55
This commit is contained in:
1 parent
4db1c809b8
commit
3829142dc0
1 file changed
+7
-1
+7
-1
@@ -968,8 +968,14 @@ Ex:
|
|||||||
```c
|
```c
|
||||||
size_t taille = sizeof 12;
|
size_t taille = sizeof 12;
|
||||||
size_t taille2 = sizeof taille;
|
size_t taille2 = sizeof taille;
|
||||||
|
size_t taille3 = sizeof (int) 12; // le 12 est facultatif avec cette écriture
|
||||||
|
```
|
||||||
|
|
||||||
|
On s'en sert pour calculer l'argument de malloc
|
||||||
|
|
||||||
|
Ex:
|
||||||
|
```c
|
||||||
|
int* p = (int*) malloc(10*sizeof(int));
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in new issue
Block a user