Skip to content

tschuchortdev/cvector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CVector

Codacy Badge Build Status License: MIT Build Status contributions welcome

CVector simple generic vector implemented in C

Installation

Simply copy the files vector.h and vector.c in your source directory.

Usage

Vector works for all types and can save copies, you don't have to allocate the elements on the heap yourself.

Vector vec = INIT_VECTOR(int);

int a = 5;
vectorAdd(&vec, &a);

int b = ((int*) vec.data)[0];
// or
int c = *(int*) vectorGet(&vec, 0);

//dont forget to free the vector
vectorDestroy(&vec);

About

Simple generic vector implemented in C

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published