Hey there, I have a class called Mixed, which handles Mixed numbers. I've also got overloaded operators to handle arithmetic between mixed numbers, which work fine until the object is added to an Int. From what I've been told, the int should automatically "upconvert" to a Mixed type via the default constructor. I've tried several variations to no avail. Any help please?
Mixed::Mixed()
{
integer = 0;
numerator = 0;
denominator = 0;
}
/*=========================================================->
The following function: Mixed( int i) 2/15/13
This is a Mixed constructor, in the event only an integer
ia passed in, it sets all other values to their default,
0,1.
<-=========================================================*/
Mixed::Mixed(int i)
{
integer = i;
numerator = 0;
denominator = 0;
}
/*=========================================================->
The following function: Mixed(const int i, const int n, const int d) 2/15/13
This is a Mixed constructor. It set's all values
passed in to the appropriate variable.
<-=========================================================*/
Mixed::Mixed(constint i, constint n, constint d)
{
integer = i;
numerator = n;
denominator = d;
}