How would one go about overloading the cin >> operator in c++ to input a fraction of unknown size/chars? Specifically, the person can enter 1/2 or 12/4 or 1/100 and it has to be able to accept any of them and input them into a numerator and denominator in a fraction object. Is there a simply command to determine where a character is in a string and then do something different with the characters before and after it?
And I can't have the person hit return/enter after inputting the numerator and denominator slash. Such as 4 (enter) / (enter) 15 (enter). They must be entered in one line and manipulated from there.
Note: I did already look at the similar questions on this site, but none seemed to address fractions which weren't composed of a single int numerator and denominator.