Advertisement
Guest User

UKOL4

a guest
Oct 18th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.86 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. class Retez {
  6.     char *retez;
  7. public: Retez(const char *r){
  8.     retez = new char[*r+1];
  9.     strcpy(retez, r);
  10. }
  11.     Retez(unsigned n){ //maybe?
  12.         //retez(new char[n]);
  13.         retez = new char[n];
  14.     }
  15.     ~Retez(){ //done
  16.       free(retez); retez = NULL;
  17.     }
  18.     void vypsat(){ //done
  19.         cout << retez << "\n";
  20.     }
  21.     friend Retez *levy(const Retez &, int);
  22.     friend Retez *pravy(const Retez &, int);
  23.     friend Retez *stred(const Retez &r, int m, int n){ //VRACÍ ŘETĚZ!!!!!!!
  24.         Retez novyRetez(n);
  25.         Retez *fRetez;
  26.         fRetez = &novyRetez;
  27.        
  28.        
  29.        
  30.         return fRetez;
  31.     }
  32. };
  33.  
  34. int main(int argc, const char * argv[]) {
  35.    
  36.    
  37.    
  38.     // insert code here...
  39.     //std::cout << "Hello, World!\n";
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement