loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.6849396123568112","path":"main.c","file":{"path":"main.c","content":{"asEncoding":{"base64":"I2luY2x1ZGUgInN0ZGlvLmgiCiNpbmNsdWRlICJzdGRsaWIuaCIKCnR5cGVkZWYgc3RydWN0IHsKICAgIGNoYXIgKiBuYW1lOwogICAgaW50IGFnZTsKfSBwZXJzb247CgppbnQgbWFpbih2b2lkKSB7CiAgLy9leHBsaWNpdCBhbGxvY2F0ZSBtZW1vcnkKICBwZXJzb24gKiBteXBlcnNvbiA9IG1hbGxvYyhzaXplb2YocGVyc29uKSk7CiAgbXlwZXJzb24tPm5hbWUgPSAiSm9obiI7CiAgbXlwZXJzb24tPmFnZSA9IDI3OwogIHByaW50ZigiTmFtZSAlcyBcbiIsIG15cGVyc29uLT5uYW1lKTsKICAKICAvL2V4cGxpY2l0IHJlY2xhaW0gbWVtb3J5IHdoZW4gbm90IHVzaW5nIGFueW1vcmUKICBmcmVlKG15cGVyc29uKTsKICByZXR1cm4gMDsKfQ=="},"asBuffer":null},"loaded":true}}
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;
}