to use malloc with dynamic array, you still need the size of the array.
int *array = malloc( 8 * sizeof(int)); <-- allocated space for 8 intergers.
free(array); // call free after done with...
Type: Posts; User: nimitzhunter
to use malloc with dynamic array, you still need the size of the array.
int *array = malloc( 8 * sizeof(int)); <-- allocated space for 8 intergers.
free(array); // call free after done with...
you meant like this?
int num [] = {76, 13, 14, 1, 55, 33, 24, 65}
you don't need the size of the array when you initialize it. however, you'd need it later when you want to operate on the...