Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TString ClearPoz(TString &s)
- {
- int poz=0;
- int n=0;
- int i,j;
- poz=3;
- n=1;
- cout<<"Clear from : "<<s.GetStr()<<endl<<"Start in pozition : "<<poz<<endl;
- // cin>>poz;
- cout<<"Clear : "<<n<<endl;
- //cin>>n;
- TString buff;
- buff.str=new char[strlen(s.str)-1];
- buff.str[0]=(char)strlen(s.str)-poz;//buff.str[0]=(char)strlen(s.str)-poz;
- strcpy(buff.str,s.str);//strcpy(buff.str,s.str);
- delete[]s.str;
- s.str=new char[buff.str[0]];
- for(i=1;i<poz;i++)
- s.str[i]=buff.str[i];
- for(i=poz+n;i<strlen(buff.str);i++)
- s.str[i]=buff.str[i];
- s.output();
- return s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement