Advertisement
nastiia_firefly

Untitled

Dec 2nd, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. TString ClearPoz(TString &s)
  2. {
  3. int poz=0;
  4. int n=0;
  5. int i,j;
  6. poz=3;
  7. n=1;
  8.  
  9. cout<<"Clear from : "<<s.GetStr()<<endl<<"Start in pozition : "<<poz<<endl;
  10. // cin>>poz;
  11. cout<<"Clear : "<<n<<endl;
  12. //cin>>n;
  13.  
  14. TString buff;
  15. buff.str=new char[strlen(s.str)-1];
  16. buff.str[0]=(char)strlen(s.str)-poz;//buff.str[0]=(char)strlen(s.str)-poz;
  17. strcpy(buff.str,s.str);//strcpy(buff.str,s.str);
  18.  
  19. delete[]s.str;
  20. s.str=new char[buff.str[0]];
  21.  
  22. for(i=1;i<poz;i++)
  23. s.str[i]=buff.str[i];
  24. for(i=poz+n;i<strlen(buff.str);i++)
  25. s.str[i]=buff.str[i];
  26.  
  27. s.output();
  28.  
  29. return s;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement