Check out example codes for "advance in c++". It will help you in understanding the concepts better.

Code Example 1

// C++ program to illustrate 
// using std::advance 
#include <bits/stdc++.h> 
  
// Driver code 
int main() 
{ 
    // Vector container 
    std::vector<int> vec; 
  
    // Initialising vector 
    for (int i = 0; i < 10; i++) 
        vec.push_back(i * 10); 
  
    // Printing the vector elements 
    for (int i = 0; i < 10; i++) { 
        std::cout << vec[i] << " "; 
    } 
  
    std::cout << std::endl; 
  
    // Declaring the vector iterator 
    std::vector<int>::iterator it = vec.begin(); 
  
    // Printing alternate elements 
    while (it < vec.end()) { 
        std::cout << *it << " "; 
        std::advance(it, 2); 
    } 
}

Learn ReactJs, React Native from akashmittal.com