Help with comparsion of two objects
What i need to do is chekc that both objects variable name "ISBN1" have the same number.
What i have so far is this:
Code:
int operator==(const ISBN& left, const ISBN& right){
int ret = 0;
if(strcmp(left.ISBN1, right.ISBN1){
ret = 1;
}
return ret;
}
...but i also need to check if incase one isbn1 has a different style, like in this case:
123123123 is the same as 12-3123-12-3 so i should return 1 in that case, but is its 123123123 and 12-3123-12-2 then its not the same since the last number should be 3
I think i can loop until i find a character which is not a number and ignore that one and proceed tot he next character, i dont know exactly how to get this done or if its even possible.