repositories
/
TD_C.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TP 8 exo1: Fix a memory allocation comment.
[TD_C.git]
/
TP_8
/
exo1
/
exo1.c
diff --git
a/TP_8/exo1/exo1.c
b/TP_8/exo1/exo1.c
index b0e5df93e53151a5cd8ad194b842f159162cc486..c810c05d6ccb19c139d82a4c2ccd27188c70d7c9 100644
(file)
--- a/
TP_8/exo1/exo1.c
+++ b/
TP_8/exo1/exo1.c
@@
-11,7
+11,8
@@
int main() {
int* arr;
printf("Longeur?\n");
int size = promptValue();
int* arr;
printf("Longeur?\n");
int size = promptValue();
- //arr = malloc(sizeof(arr[size])); prend la taille de l'élément à la position de l'index = size
+ //arr[size];
+ //arr = malloc(sizeof(arr));
arr = malloc(sizeof(int)*size);
for (int i = 0; i < size; i++) {
arr = malloc(sizeof(int)*size);
for (int i = 0; i < size; i++) {