C with quality of life functions and macros.
- Dynamic arrays;
- String formatting;
- File system interaction;
- Run external programs.
Specify only basic functionality:
...
#define BETTER_C_IMPLEMENTATION
#include "betterC.h"
...
Implement all functions and macros:
...
#define BETTER_C_ALL
#include "betterC.h"
...
Create your structure, for example a dynamic array of string would be:
typedef struct StringsDA {
char **items;
long long int size;
long long int capacity;
} StringsDA;
You can now dynamicaly allocate and use your strings:
StringsDA strings = {0};
da_append(&strings, "Hello");
da_append(&strings, "World");
printf("%s %s\n", strings.items[0], strings.items[1]);
da_free(strings);