Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main() {
- int x;
- printf("Enter int: ");
- scanf("%d",&x);
- printf("Allocating an int array of length: %d\n",x);
- int * pX = malloc(x*sizeof(int));
- printf("Freeing the int array. Some languages do this automatically!\n");
- free(pX);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement