Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- void func(char *str, char symbol)
- {
- int del_count = 0, i =0;
- while (str[i] != '\0')
- {
- while (str[i+ del_count] == symbol)
- del_count++;
- str[i] = str[i + del_count];
- i++;
- }
- }
- void main()
- {
- //char str[] = "aaaabbcacdjaaahsgfrjhdgsaab";
- //func(str, 'a');
- string str1 = "s43";
- string str2 = "sasdfgy435436htr";
- cout << str1.find(' ');
- str1.resize(40, '3');
- str1.append("2354");
- cout << str1[42] << '\n';
- cout << str1.c_str() << '\n';
- //cout << (str1.find("te")) << '\n';
- try {
- cout << str1.capacity() << '\n';
- cout << str1.length() << '\n';
- }
- catch (exception ex)
- {
- cout << ex.what();
- }
- std::cout << str1.c_str() << '\n';
- std::cout << str1.length() << '\n';
- std::cout << str2.length() << '\n';
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement