Check out example codes for "how to make vector empty in c++". It will help you in understanding the concepts better.

Code Example 1

Input  : myvector= {1, 2, 3, 4, 5};
         myvector.clear();
Output : myvector= {}

Input  : myvector= {};
         myvector.clear();
Output : myvector= {}

Learn ReactJs, React Native from akashmittal.com