Hello! I am trying to create a dynamic vector (as is in here; it's from an assignment - it has to respect this format. Bear in mind that names in here are not reserved words as this is translated from spanish).
There's a routine/function that's called vector_obtain, and must save in "value" the value from vector's position "pos". I am not told what data type does vector contain. vector_get_size does what it says on the tin.
Although it compiles, it doesn't work. This routine runs after "vector_save_on", a function that saves certain values on the vector I've to work with. What am I doing wrong?
should read: vector->data[pos] = value;
it's because the indexing operator (i.e. subscript operator) automatically takes account of the site of the data being pointed to.