Advertisement
nastiia_firefly

Untitled

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