Advertisement
nastiia_firefly

Untitled

Nov 14th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. TString TString::operator%(TString &s2)//--------------------(!!!!!)
  2. {
  3. TString sop;
  4. int sz;
  5.  
  6. sz=strlen(str)+strlen(s2.str)-2;
  7. sop.str=new char[sz+1];
  8. sop.str[0]=sz;
  9.  
  10. strcpy(sop.str+1,this->str+1);
  11.  
  12. bool flag;
  13.  
  14. for(int i=1,k=strlen(sop.str)-1; i<strlen(sop.str); i++)
  15. {
  16. flag=true;
  17.  
  18. for(int j=1;j<strlen(s2.str);j++)
  19. {
  20. if(sop.str[i]==s2.str[j])
  21. {
  22. flag=false;
  23. break;
  24. }
  25. }
  26. if(flag)
  27. {
  28.  
  29. sop.str[k]=s2.str[i];
  30. sop.output();
  31. k++;
  32. }
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement