Code:
#include <iostream.h>
#include <string.h>
string del1(string sor, string dis){
string temp;
string::iterator sor_ptr = sor.begin();
while(sor_ptr <= sor.end()) {
bool found = false;
string::iterator dis_ptr = dis.begin();
for(; dis_ptr<=dis.end(); dis_ptr++) {
if (*sor_ptr == *dis_ptr){
found = true;
}// if
}// for
if (!found) temp+= *sor_ptr;
sor_ptr++;
}// While loop
return temp;
}// del1
string operator - (string & left, string & right){
// catenate two string values, forming a new string
string res= del1( left, right);
return res; // return result
// we can also writ here the body of del1 function
}
int main(){
/* string s1= " thisisnotfun";
string s2= s1 - "not";
cout<< s2<< endl; */
string source;
string dist;
string edit1;
cout<< " I did submet the tags with the code"<< endl;
cout<<"can you help me now"<< endl;
cout<< "Please inter the first string"<<endl;
getline(cin, source);
cout<< "Please inter the second string"<<endl;
getline(cin,dist);
edit1 = del1(source, dist);
cout << edit1 << endl;
return 0;
}
Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaha