Name: Anonymous 2016-07-20 3:56
Must support:
* Adding elements
* Regrowing
* Adding elements
* Regrowing
std::vector<int> vec;
in plain C, since C doesn't support namespaces or templates. You could implement a struct and appropriate functions to create an automatically resizing array-like data structure, which is really what I think >>1 is asking for. Making it type-generic like std::vector without resorting to making a new version of the struct and associated functions for each data type would be tricky and probably require messing around with pointers and casting, though that would actually be more elegant than what C++ templates actually do (they basically are macros that create multiple type-specific versions of functions and classes at compile time).