Well I got it working, when using headers, does it matter where they are saved?
Also, In my fraction class from the book, I created a member function as
Code:
friend ostream &operator<<(ostream &os, Fraction &fr);
for easy printing of fractions. I was unable to get the code to work until I commented out all pieces containing the above friend function.
When that was not commented and I tried to compile I get the error:
Code:
Floatfract1\fract.h|73|error: ISO C++ forbids declaration of 'ostream' with no type|
Floatfract1\fract.h|73|error: 'ostream' is neither function nor member function; cannot be declared friend|
Floatfract1\fract.h|73|error: expected ';' before '&' token|
Floatfract1\fract.h||In member function 'void Fraction::set(int, int)':|
Floatfract1\fract.h|14|error: 'normalize' was not declared in this scope|
Floatfract1\fract.h||In constructor 'Fraction::Fraction(int, int)':|
Floatfract1\fract.h|32|error: 'normalize' was not declared in this scope|
||=== Build finished: 5 errors, 0 warnings ===|
not quite sure why this error occurs, if I simply paste the fraction class in instead of referring with a header it runs perfectly fine.
Also, thanks for the quick response.