Skip to content

andrsur/svecc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SVECC - Simple VeCtor(dynamic array) C

Features

  • creating dynamic arrays
  • memory controll (allocate, free)
  • removing with move index

Guide (examples in examples dir)

for char similarly

VecInt vec = vec_int_new();

push to array

vec_int_push(&vec, number);

edit element

vec_int_set(&vec, index, number);

remove element

vec_int_remove(&vec, index);

get element

vec_int_get(&vec, index);

get length

vec_int_len(&vec);

free allocated memory

vec_int_free(&vec);

Simple example

#include <vec_int.h>

int main() {
  VecInt vec = vec_int_new();
  vec.push(&vec, 12);
  vec.push(&vec, 34);
  
  printf("size=%zu\n0=%d\n1=%d\n", vec_int_len(&vec), vec_int_get(&vec, 0), vec_int_get(&vec, 1));
}

About

Simple VeCtor(dynamic array) C

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages