1#include <iostream>
2#include <string>
3
4int main()
5{
6 string str{}; // creating string
7 getline(cin, str);// using getline for user input
8 std::cout << str; // output string namePerson
9 if (str[0] >= 'a' || str[0] <= 'z')
10 str[0] -= 32;
11 return (0);
12}
1// string::at
2#include <iostream>
3#include <string>
4
5int main ()
6{
7 std::string str ("Test string");
8 for (unsigned i=0; i<str.length(); ++i)
9 {
10 std::cout << str.at(i);
11 }
12 return 0;
13}