Hey there everyone, I'm doing a project for school and I have it completely working right now. There's 1 part of the project that I don't know how to do...Make the array that's inside of a struct, dynamic.
If anybody could help me, I'd greatly appreciate it.
Code:typedef struct { VectorItemT items[DEFAULT_CAPACITY]; int size; int capacity; }VectorT;These are in separate files.... Anybody got a clue where to start?Code:VectorT *newVector() { VectorT *ptr_malloc = (VectorT*)malloc(sizeof(VectorT)); ptr_malloc->size = 0; ptr_malloc->capacity = 5; return ptr_malloc; }
I've read several tutorials & other posts, it just doesn't click when I read them.
What else do you need to know?
Thanks ahead of time.