Advertisement
nastiia_firefly

Untitled

Nov 18th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. TString ClearPoz(TString &s)//---------------------------?
  2. {
  3.  
  4. TString buff;
  5.  
  6. buff.str=new char[strlen(s.str)+1];
  7. buff.str[0]=(char)strlen(s.str)-1;
  8.  
  9. strcpy(buff.str,s.str);
  10. delete[]s.str;
  11.  
  12. int poz=1;
  13. int n=2;
  14.  
  15. for(int i=1;i<=poz;i++)
  16. {
  17. s.str[i]=buff.str[i];
  18. cout<<s.str[i];
  19. }
  20.  
  21. for(int i=n+poz;i<=buff.str[0];i++)
  22. {
  23. s.str[i+poz+n]=buff.str[i+poz];
  24. cout<<s.str[i];
  25. }
  26.  
  27. return s;
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement