Skip to content

Instantly share code, notes, and snippets.

@hiramekun
Created October 16, 2018 00:12
Show Gist options
  • Save hiramekun/8c49a515a61b13740026596478e7e7e9 to your computer and use it in GitHub Desktop.
Save hiramekun/8c49a515a61b13740026596478e7e7e9 to your computer and use it in GitHub Desktop.
mallocの動作確認
#include <stdio.h>
#include <stdlib.h>
main() {
char *a = malloc(1000);
char *b = malloc(1000);
char *c = malloc(1000);
char *d = malloc(1000);
printf("a:%lu\n", a);
printf("b:%lu\n", b);
printf("c:%lu\n", c);
printf("d:%lu\n\n", d);
free(a);
char *e = malloc(1000);
printf("e:%lu\n", e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment