Skip to content

Instantly share code, notes, and snippets.

@Silva97
Last active November 15, 2019 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Silva97/ff9956ef8db8ab861bcb69ff5e4b027b to your computer and use it in GitHub Desktop.
Save Silva97/ff9956ef8db8ab861bcb69ff5e4b027b to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#define ASIZE 4
int main(void)
{
// char *a[ASIZE];
char **a = malloc(sizeof (char *) * ASIZE);
for (int i = 0; i < ASIZE; i++)
a[i] = malloc(32);
for (int i = 0; i < ASIZE; i++)
free(a[i]);
free(a);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment