Bullfrog1870
Technical User
I'm trying to work on the "Fractions" implementation in C++. I've been given the header as follows but can't figure out how to implement the functions for getFract / putFract. The user would type "1 2" to represent 1/2. Can someone help? Thanks!
....excerpt from fraction.h
/******************* I/O *********************************/
static int getFract(istream &infile, Fraction &f);
/* returns 1 if a valid fraction is read
0 if an invalid fraction is read
EOF if end of file is detected
*/
static void putFract(ostream &outfile, const Fraction &f );
....excerpt from fraction.h
/******************* I/O *********************************/
static int getFract(istream &infile, Fraction &f);
/* returns 1 if a valid fraction is read
0 if an invalid fraction is read
EOF if end of file is detected
*/
static void putFract(ostream &outfile, const Fraction &f );