Skip to content
This repository was archived by the owner on Jul 25, 2023. It is now read-only.
/ c-vector Public archive

A simple header-only implementation of a dynamic array (vector) in C

License

Notifications You must be signed in to change notification settings

EimaMei/c-vector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Note as of 2024-07-26

Don't use this, use siArray in my single header repository sili.h. Same thing except 1000000x times better with more features and what not.

C vector

A very simple header-only implementation of a dynamic array (vector) in C with all the required features for a dynamic array.

Features

  • Simple to use.
  • Portable as it's header-only and written in C89.
  • Small in size.
  • Very simple and basic source code, no overcomplications.

Usage

To use it you must define VECTOR_IMPLEMENTATION once before including vector.h.

#define VECTOR_IMPLEMENTATION
#include <vector.h>

Explanations on what each function does are in vector.h. There's also a provided example here, utilizing all of the features of the library.

Credits

Original implementation is by this article
Majority of the source code credit goes to that article. I only added a few new features and improvements to the code, and turned it into a small and simple portable header file.

About

A simple header-only implementation of a dynamic array (vector) in C

Topics

Resources

License

Stars

Watchers

Forks

Languages