Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

You have 10 seconds to implement std::vector in plain C

Name: Anonymous 2016-07-20 3:56

Must support:

* Adding elements
* Regrowing

Name: Anonymous 2017-01-05 23:35

>>58
An auto-resizing dynamic array is basically a vector already, it's just useful to have the resizing process streamlined rather than have to manually call realloc every time you do something. And a vector is already easily capable of functioning as a stack, its size (number of elements) multiplied by the size in bytes of each element, gives you an offset from the base of the vector's data block that can be easily used similarly to a stack pointer.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List