Hey. I'm coding an abstract data type for a rational number. I have been attempting to code the operator overload for insertion, but when doing so i recieve errors telling me that the objects members are private (and thus, cannot be accessed) despite it being a friend function. If someone may have any ideas about what may be wrong here, I would of course appreciate it

##FUNCTION DEFINITION FOR OVERLOAD##

Code:

ostream& operator <<(ofstream& outs, const rational& temp){
if (!temp.positive)
outs << "-";
outs << temp.ratNum[0] << "/" << temp.ratNum[1];
return outs;
}

##HEADER FILE W/ CLASS DEFINITION##

Code:

#include <iostream>
#include <fstream>
using namespace std;
const int size = 2;
class rational{
friend rational operator+(const rational&, const rational&);
friend rational operator-(const rational&, const rational&);
friend rational operator*(const rational&, const rational&);
friend rational operator/(const rational&, const rational&);
void friend subtractRational(rational&, rational&, rational&);
void friend addRational(rational&, rational&, rational&);
void friend multRational(rational, rational, rational&);
void friend divRational(rational, rational, rational&);
void friend lcd (rational&, rational&);
void friend gcf(rational&);
friend ostream& operator<<(ostream&, const rational&);
friend istream& operator>>(istream&, const rational&);
public:
void output();
rational operator =(const rational&);
rational(int);
rational(void); // void constructor
rational(int, int); // constructor for creating rational number
~rational(); // destructor
rational(const rational&);
private:
int *ratNum;
bool positive;
};