Question: Below is my code, I keep getting the errors: fractionType:t is not valid template type argument for parameter T and t: undeclared identifier Please help
Below is my code, I keep getting the errors:
"fractionType":"t" is not valid template type argument for parameter "T"
and
"t": undeclared identifier
Please help me out to fix these errors
#include
using namespace std;
// class definition template
public: // default constructor fractionType() {}
// parameterized constructor fractionType(T a, T b) { num = a; den = b; }
// overload the stream insertion operators friend ostream& operator<<(ostream& out, fractionType
friend istream& operator>>(istream& in, fractionType
// overlaod the arithmetic operators friend fractionType
friend fractionType
friend fractionType
friend fractionType
// overload the relational operators friend bool operator<(fractionType
friend bool operator>(fractionType
friend bool operator<=(fractionType
friend bool operator>=(fractionType
friend bool operator==(fractionType
};
// small main function to test some operators and functions int main() { fractionType
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
