Skip to content

m4yawashere/betterC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 

Repository files navigation

betterC

C with quality of life functions and macros.

Features

  • Dynamic arrays;
  • String formatting;
  • File system interaction;
  • Run external programs.

How to use

Specify only basic functionality:

...
#define BETTER_C_IMPLEMENTATION
#include "betterC.h"
...

Implement all functions and macros:

...
#define BETTER_C_ALL
#include "betterC.h"
...

Dynamic Array

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);

About

Swiss Army knife for the C programmer.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages