Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

indexing strings in c++

// 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;
}
Source by www.cplusplus.com #
 
PREVIOUS NEXT
Tagged: #indexing #strings
ADD COMMENT
Topic
Name
5+8 =