#include <iostream> #include <string> using namespace std; int main() { string word = "Hello"; cout << word[0] << "\n"; // H cout << word[1] << "\n"; // e cout << word[4] << "\n"; // o return 0; }
Click Run to execute this code.