Can you go farther than that ...
hi ErionD,
Please can you discribe it in more details...
Please tell me more about it ...
Is this OK... As a Code Tage
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;
}
:p Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaha
I am not allow to use these functions...
guys thanks for your help ...
You know as a bigner, I am here to learn ... and Sorry for making problems... but the thing that I want to say is : " I am not allow to use the string function that came with thew string lib."
I want to implement a new operator to add it to the string lib functions and operators.....
It is very easy to use the strtok and strcpy and strcat...
According to the Prof. I solve it in a right way ... but he want me to implement the "-" operator... insted of using the Del1 function ...
and I don't know how to implement this operator using the C++ syntax.
Can you do it for me.... ?
So this is the header of the - opertaor
Can I say that is the header of the " -" operator...
and inside it I should write what I did before...
Code:
friend string operator-(string sor ,string dis);
Question: Why it is Firend ?
And is this the way to write Using a Code tage right ... :( Tell me ?
Thanx...
you know step by step.... this is the way ... :)