A lightweight, header-only C library for working with dynamic strings.
It provides a simple string struct with built-in memory management, append operations, and formatted string construction — without needing to manually handle malloc, realloc, and strlen everywhere.
- Header-only (just include it)
- Simple
stringstruct withdata,length, andcapacity - Safe creation from literals, sections, or formatted strings
- Append support (with optional
destroyto avoid leaks) - Automatic cleanup with
string_drop - Colored log macros (
LOGF,WARNF,ERRORF)
Simply copy cstring.h into your project and include it:
#include "cstring.h"