C: ReSize array

Viewed 94

I've been doing some research about resizing, dynamic allocation, etc. in C. But I still can't quite understand the following:

Imagine I declare an integer array int vec[1000] and I fill it with a number sequence that I extract from a file using gets. But, in the end, I ended up using only 100B and not the declared 1000B. How can I eliminate the unused declared space?

0 Answers
Related