Hallocy/Src/Main.c

23 lines
No EOL
481 B
C

#include <stdio.h>
#include <Hallocy/Allocator.h>
int main() {
char *memory = (char *)hallocy_malloc(3);
if (memory == NULL) {
printf("Failed it allocate memory!");
return -1;
}
memory[0] = 'H';
memory[1] = 'i';
memory[2] = '\0';
printf("%s\n", memory);
int code = hallocy_free(memory);
if (code != HALLOCY_ERROR_NONE) {
printf("Failed to free memory error code (%d)!", code);
return -1;
}
return 0;
}