Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <iostream>
- #include <string>
- #include <cstring>
- using namespace std;
- string s_1 = "SONY";
- char sz_1[73] = "_Pictures.";
- ////////////////////////////////////////////////////////////////////
- int main() //
- {
- s_1 += sz_1;
- cout << "1: " << s_1 << endl;
- printf("The length of \"str_1\" = %d \n", s_1.length());
- strcpy(sz_1, s_1.c_str());
- printf( "2: %s \n", sz_1);
- return 0;
- }
- #include <iostream>
- #include <iomanip>
- using namespace std;
- string s1 = "Lisicin Valerievich";
- string s2 = "Victor";
- //////////////////////////////////////////////////////////////////
- int main() //
- {
- int n = s1.find(" ");
- cout << "n = " << n << endl;
- s1.insert(n, s2);
- s1.insert(n, " ");
- cout << "s1 = " << s1 << endl;
- }
- #include <iostream>
- #include <string>
- using namespace std;
- //////////////////////////////////////////////////////////////////
- int main()
- {
- string s1 = "Akbulatov Maxim Aleksandrovich Sony Pictures";
- int n = 0;
- do { n = s1.find(" ", n+2);
- if(n == -1) break;
- s1.insert(n, ",");
- } while(1);
- cout << s1 << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement