How to allocate memory in C language

How to allocate memory in C language

When allocating memory, specify the size of the allocation:

int array_length = 100;
int *array = (int*) malloc(array_length * sizeof(int));

char *array = (char*) malloc(array_length * sizeof(char));
Sou‮ww:ecr‬w.lautturi.com
Created Time:2017-08-29 09:31:23  Author:lautturi