I receive a C2760 error when trying to compile my program. It is coming from this section of code. This is a LinkedList.h file that works with other files.
everything
void Insert(T data)
{
if (head == nullptr) //If the list is empty
{
head = new Node<T>(data, nullptr)
} //error C2760 Given from this line. Tutor was unable to fix
else
{
Node<T> *temp = head
Node<T> *tempT = nullptr
while (temp != nullptr && temp->data <data):
{
tempT = temp
temp = temp->next
}
if (temp == nullptr)
{
tempT->next = new Node<T>(data, nullptr)
}
else if (temp == head)
{
tempT = new Node<T>(data, head)
head = tempT
}
else
{
tempT->next = new Node<T>(data, temp)
}
}
}
State Error C2760 syntax error: unexpected token '}', expected ';'
a fix in this error