- // For C++ libraries.
- #include <iostream>
- // Library for strings.
- #include<string>
- using namespace std;
- int main() {
- string word="Book";
- string word2="airplane";
- cout << word << endl;
- word[1]='i';
- word[2]=word[3];
- word[3]='e';
- cout << word << endl;
- cout << endl;
- cout << word2.substr(0,3) << endl;
- return 0;
- }