class polynomial{
public:
int coeff;
int expo;
class polynomial *next;
//Declaring the functions within the class
polynomial input();
polynomial output();
polynomial addition(polynomial poly);
polynomial multiplication(polynomial poly);
polynomial subtraction(polynomial poly);
};
class polynomial x, y, z;
Can't understand :
class polynomial *next;
Do I need the word "class" here ?
class polynomial x, y, z;
What is this ? Why put it after the class declaration ?
I am not sure but in C you put struct before declaring an object of that struct I am guessing you can do the same with classes but I know you do not have to you can just write polynomial x , y , and z. I may be wrong though.
This line is outside int main() or any other function,so is it useless ?
No. It create three instances of type polynomial outside the scope of everything. They are what is known as "global variables". They are bad and are to be avoided.