What i need to do is chekc that both objects variable name "ISBN1" have the same number.
What i have so far is this:
...but i also need to check if incase one isbn1 has a different style, like in this case:Code:int operator==(const ISBN& left, const ISBN& right){ int ret = 0; if(strcmp(left.ISBN1, right.ISBN1){ ret = 1; } return ret; }
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.



LinkBack URL
About LinkBacks




tr_fun are a bit hard for you now, defining your own separate one-line function for remove_if would still be greatly simpler than writing the whole loop for stripping characters.