False result from copy a vector
hieutran29 opened this issue · comments
Hieu Tran commented
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.
Evan Teran commented
Yea, this isn't c++, so we can't overload the assignment operator. But sure, your cvector_copy
seems reasonable enough :-)