Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TString s1_input_s2( TString &s1, TString &s2)//-------------------------------------?
- {
- TString buff;
- int poz;
- buff.str=new char[strlen(s1.str)-1];
- strcpy(buff.str,s1.str);
- int temps=buff.str[0]+s2.str[0];
- s1.~TString();
- s1.str=new char[temps+1];
- poz=3;
- for(int i=1 ;i <= poz; i++)
- {
- s1.str[i]=buff.str[i];
- }
- for(int i=1;i<=s2.str[0];i++)
- {
- s1.str[i+poz]=s2.str[i];
- }
- for(int i=poz-1;i<=buff.str[0];i++)
- {
- s1.str[s2.str[0]+i+poz]=buff.str[i+poz+1];
- }
- //s1.str[0]=temps-2;
- return s1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement