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

False result from copy a vector

hieutran29 opened this issue · comments

When I tried to copy a vector to a new one using the operator =, everything went fine until I changed a value of the original vector, the second vector changed alongside the original vector. It is expected that the second vector didn't change whether the original one made any change.
I suggest implementing a function cvector_copy() to fix the issue.

Yea, this isn't c++, so we can't overload the assignment operator. But sure, your cvector_copy seems reasonable enough :-)