eteran / c-vector

A dynamic array implementation in C similar to the one found in standard C++
MIT License
737 stars 109 forks source link

How to get last element before pop #63

Closed tazok81 closed 11 months ago

tazok81 commented 11 months ago

Hi,

I need to remove the last element from vector with "pop", but I need to process that element after pop. Please how get I get it? I expected function like back()...Or maybe how get the element at index?

tazok81 commented 11 months ago

seems v[size-1]; works

eteran commented 11 months ago

Yup, that's exactly how