daily pastebin goal
1%
SHARE
TWEET

strstr

Coman22 Mar 26th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int main()
  2. {
  3.     char a[50],b[50],*p;
  4.     int l;
  5.     cout<<"Introduceti sirul: ";cin.get(a,50);
  6.     cin.get();
  7.     cout<<"Introduceti subsirul: ";cin.get(b,50);
  8.     cin.get();
  9.    
  10.     l=strlen(b);
  11.     p=strstr(a,b);
  12.     while(p)
  13.     {
  14.         strcpy(p,p+l);
  15.         p=strstr(a,b);
  16.     }
  17.    cout<<"Sirul nou este: "<<a<<endl;
  18.  
  19.     return 0;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top