From: Jerome Benoit Date: Fri, 3 Mar 2017 19:12:53 +0000 (+0100) Subject: TP 8 exo1: Fix a memory allocation comment. X-Git-Url: https://git.piment-noir.org/?p=TD_C.git;a=commitdiff_plain;h=1d97ec3c592317db3549070d2e01c28d444f8b45 TP 8 exo1: Fix a memory allocation comment. Signed-off-by: Jerome Benoit --- diff --git a/TP_8/exo1/exo1.c b/TP_8/exo1/exo1.c index b0e5df9..c810c05 100644 --- 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(); - //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++) {