eteran / c-vector

A dynamic array implementation in C similar to the one found in standard C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to pass this vector as a parameter

roaming2man opened this issue · comments

It will be very nice if there is a code to pass this cvector as a parameter in example.c or test.c file.
I tried like followings but doesn't work.

int foo(cvector_vector_type(int)* v) {
cvector_push_back(*v, 55);
cvector_push_back(*v, 66);
cvector_push_back(*v, 77);
return 0;
}

int main() {
... skp ...
cvector_vector_type(int) v = NULL;
foo(&v);
... skip ...
}

How can I pass this vector as a parameter?

@roaming2man #17 its similar to my issue

@TVKain Yes, that's exactly what I've been looking for. Thanks!