Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void PushBack(Vector* v, void* d){
- Eltype T = GetElType(v);
- if (T == INT) PushBackI(v, d);
- else if (T == COMPLEX) PushBackC(v, d);
- else UnknownType();
- }
- void PushBackI(Vector* v, int* d){
- if (GetCapacity(v) < GetSize(v) + 1) ExpandCapacity(v);
- SetSize(v, GetSize(v) + 1);
- SetElement(v, GetSize(v) - 1, d);
- }
- void PushBackC(Vector* v, complex* c){
- if (GetCapacity(v) < GetSize(v) + 1) ExpandCapacity(v);
- SetSize(v, GetSize(v) + 1);
- SetElement(v, GetSize(v) - 1, c);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement