Hello, everyone! I made an account on this website because I'm having trouble with a particular program. I'm supposed to be writing a Polynomial class with a linked list to hold coefficients and an integer for the degree. I keep getting a fatal error LNK1561, though, and I don't know how to fix it. Here's the code I have so far:
#include <iostream>
using namespace std;
typedef int ElementType;
class Polynomial
{
private:
class Node
{
public:
ElementType coef;
ElementType exp;
Node * next;
Node(Node * next1 = NULL)
{
coef = 0;
exp = 0;
next = next1;
}
};
typedef Node* NodePointer;
public:
Polynomial(ElementType a, ElementType b)
{
first = NULL;
Node * temp = new Node;
temp -> coef = a;
temp -> exp = b;
first = temp;
}
void insert(ElementType a, ElementType b)
{
Node * temp1;
temp1 = new Node;
temp1 = first;
while (temp1 -> next != NULL)
temp1 = temp1 -> next;
temp1 -> coef = a;
temp1 -> exp = b;
first = temp1;
}
private:
NodePointer first;
int mySize;
};
. Can anybody help me figure out where I went wrong?