Mega Code Archive

 
Categories / C / Code Snippets
 

Allocate memory

#include <stdlib.h> #include <stdio.h> int main() { float *j; j = calloc(100, sizeof(float)); if(!j) { printf("Allocation Error\n"); exit(1); } return 0; }