Check out example codes for "how to append an element to an array in cpp". It will help you in understanding the concepts better.

Code Example 1

std::vector<std::string> x = {"a", "b", "c"};
x.push_back("d");

Learn ReactJs, React Native from akashmittal.com