Blog and Playground
Kevin Kreutz
© 2026. All rights reserved.
int *x; if ((x = (int *)malloc(sizeof(int) * 200)) == NULL) { printf("memory allocation failure.\n"); exit(1); }
int *x;
if ((x = (int *)malloc(sizeof(int) * 200)) == NULL) {
printf("memory allocation failure.\n");
exit(1);
}
allocates memory for 200 integers. x points to the memory address.
free(x);
to free the allocated memory space again