Check out example codes for "c++ pass vector by pointer". It will help you in understanding the concepts better.

Code Example 1

// C++ program to demonstrate how vectors 
// can be passed by reference. 
using namespace std; 
// The vect is passed by reference and changes 
// made here reflect in main() 
void func(vector<int> &vect) 
int main() 
    vector<int> vect; 
    for (int i=0; i<vect.size(); i++) 
       cout << vect[i] << " "; 
    return 0; 

Learn ReactJs, React Native from