How would I get the user to input a fraction like 1/2, and have the program distinguish the numerator from the denominator?

Printable View

- 12-12-2002abregefraction help
How would I get the user to input a fraction like 1/2, and have the program distinguish the numerator from the denominator?

- 12-12-2002Magos
Get input as a string, transform the digits before the / into one number, and the ones after the / into another.

Or let the user input two numbers instead of one. - 12-12-2002abregeQuote:

*Originally posted by Magos*

**transform the digits before the / into one number, and the ones after the / into another.**

- 12-12-2002Magos
atoi (array to integer)

**int atoi(const char*);** - 12-12-2002abrege
Thanks, thats what I was looking for!