str.at(pos);
#include<iostream> using namespace std; int main() { string str = "Welcome to lidihuo tutorial"; cout<<"String contains :"; for(int i=0; i<str.length(); i++) { cout<< str.at(i); } cout<<'\n'; cout<<"String is shown again"; for(int j=0 ; j<str.length(); j++) { cout<< str[j]; } return 0; }
String contains Welcome to lidihuo tutorial