loading
open in
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "stdio.h"
#include "stdlib.h"

typedef struct {
    char * name;
    int age;
} person;

int main(void) {
  //explicit allocate memory
  person * myperson = malloc(sizeof(person));
  myperson->name = "John";
  myperson->age = 27;
  printf("Name %s \n", myperson->name);
  
  //explicit reclaim memory when not using anymore
  free(myperson);
  return 0;
}