Last active
October 7, 2015 08:47
-
-
Save Mach12/7cafe77a7c9eba159345 to your computer and use it in GitHub Desktop.
Revisions
-
Mach12 revised this gist
Oct 7, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ int main() int someArray[10]; int* somePointer = malloc( sizeof(int) * 10 ); // Changer la taille de somePointer somePointer = realloc(somePointer, sizeof(int) * 15); // Ca c'est valide: -
Mach12 created this gist
Oct 7, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ #include <stdlib> int main() { // Exactement la même chose // sauf que le 2e est alloué int someArray[10]; int* somePointer = malloc( sizeof(int) * 10 ); // Changer la taille et somePointer somePointer = realloc(somePointer, sizeof(int) * 15); // Ca c'est valide: someArray[8] = 2; // Et ça aussi somePointer[12] = 15; return EXIT_SUCCESS; }