| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Dynamic array implementation in C with a modular, folder-based structure.
my-c-array/ ├── Makefile ├── build.sh ├── build.bat ├── libmyarray.a (after build) ├── src/ │ ├── array_append/ │ │ ├── array_append.c │ │ └── array_append.h │ └── ...
chmod +x build.sh
./build.shOr using make:
makebuild.batThis will compile the source files under src/, place the object files in build/, and generate a static library libmyarray.a or an executable if you add a main.c.
Here’s what the base array type looks like:
#ifndef _ARRAY_TYPE_H_
#define _ARRAY_TYPE_H_
#include <stddef.h> // for size_t
typedef void (*array_free_func_t)(void*);
typedef struct {
void** items; // actual data
size_t capacity; // total capacity
size_t size; // current number of elements
array_free_func_t freer; // custom free function (NULL means no-op)
} array_t;
#endifMIT License
© 2025 Max Base
| Back | FazBrowse Home | New Git URL |