Here is class for rational numbers
#ifndef RATIONAL_H
#define RATIONAL_H
class rational{
public:
rational(short =0,short=0,short=0, short=0);
~rational();
void setRational(short =0,short=0,short=0, short=0);
void Add();
void Subtract();
void Multiply();
void Divide();
void PrettyPrint(char ch);
void floatPrint();
private:
short r1;
short r2;
short r3;
short r4;
};
#endif // RATIONAL_H
#ifndef RATIONAL_H
#define RATIONAL_H
class rational{
public:
rational(short =0,short=0,short=0, short=0);
~rational();
void setRational(short =0,short=0,short=0, short=0);
void Add();
void Subtract();
void Multiply();
void Divide();
void PrettyPrint(char ch);
void floatPrint();
private:
short r1;
short r2;
short r3;
short r4;
};
#endif // RATIONAL_H
To copy to clipboard, switch view to plain text mode
Upon compiling I get an error for my destructor:
H:\C++_How_To_Program\chap06\rational_numbers/main.cpp:101: undefined reference to `rational::~rational()'
This occurs in any class I create. I can't figure out why.
Bookmarks