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

Code Example 1

// string::operator[]
#include <iostream>
#include <string>

int main ()
{
  std::string str ("Test string");
  for (int i=0; i<str.length(); ++i)
  {
    std::cout << str[i];
  }
  return 0;
}

Learn ReactJs, React Native from akashmittal.com