Advertisement
evcamels

lr2

Oct 28th, 2021
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cstdlib>
  4. #include <cstdio>
  5. #include <istream>
  6. using namespace std;
  7. class String{
  8. char *str;
  9. char *str_return;
  10. public:
  11.     String( string s){
  12.         if (!(s.size() < 12)) s.erase(0, s.find('('));
  13.         cout << s << endl;
  14.     }; //конструктор по-умолчанию
  15. ~String(); //деструктор
  16. };
  17. String::~String(){
  18. delete[] str;
  19. };
  20. int main (){
  21. string s;
  22. cout<<"Type anything and press:"<<endl;
  23. getline(cin,s); //считываем полностью всю строку
  24.     String str(s);
  25.     str.~String();
  26.     return 0;
  27. };
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement