natural007 Posted December 3, 2014 Posted December 3, 2014 Rulat : Codeblocks. #include <iostream> #include <string.h> using namespace std; int main() { char a[50],*p,cuvant[30]; cout<<"Introduceti o propozitie: "<<endl; cin.get(a,50); cout<<"Acum introduceti un cuvant: "<<endl; cin>>cuvant; p=strstr(a,cuvant); while(p) { strcpy(p,p+strlen(cuvant)); p=strstr(p,cuvant); } cout<<"Cuvantul "<<">> "<<cuvant<<" <<"<<" a fost gasit in propozitie si a fost sters."<<endl; cout<<a; } Quote
Blitzzzzzzzzzzzzzzz Posted December 17, 2021 Posted December 17, 2021 ba cum functioneaza asta? de ce se schimba a cand nici nu te atingi de el? Quote
Prodan Posted January 9, 2022 Posted January 9, 2022 On 12/17/2021 at 3:40 PM, Blitzzzzzzzzzzzzzzz said: ba cum functioneaza asta? de ce se schimba a cand nici nu te atingi de el? salut. p este pointer ce pointeaza catre a, in acest fel se motifica a. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.