you would like to overload constructor on same type argument.
class Rational
{
private:
int x, y;
static Rational rectangular(int, theX, theY)
{
return Rational(theX, theY);
}
static Rational polar(int userX, int userY)
{
return Rational(userX * angle, userY * angle);
}
};
Monday, July 20, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment