28 fprintf(stderr,
"[ERROR] Allocation Error\n");
38 static void Resize(
Vector * vec)
42 if(NULL == vec-> elements)
44 fprintf(stderr,
"[ERROR] Memory reallocation error\n");
76 fprintf(stderr,
"[ERROR] Bad element access\n");
The vector data structre.
unsigned long int elementSize
Vector * NewVector(unsigned long int elementSize)
Create a new vector.
int VectorAppendCopy(Vector *vec, void *element)
Inserts a new element at the end of the vector.
Vector * DeleteVector(Vector *vec)
Delete the vector and its elements.
int VectorAllocateOne(Vector *vec)
Allocates space for at least one more element.
void * VectorGetElement(Vector *vec, int position)
Gets the element at informed position.