#include<iostream> using namespace std; main() { string my_str = "Hello World"; for(int i = 0; i<my_str.length(); i++) { cout << my_str.at(i) << endl; //get character at position i } }