i'm trying to return a reference/pointer node from a linked list that i create. here is my class and the method Return node, when i pass a value it does a look up in my list, but the compiler is giving me three errors: 1-error C2143: syntax error : missing ';' before '*' 2-error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 3-error C1903: unable to recover from previous error(s); stopping compilation
Can somebody help me with that? Thank you very much!
template <class Type>
class LinkedList
{
private:
struct Node
{
Type value;
Node* next;
};
Node* list;
public:
//Other functions here
Node* FindNode(Type);
};
template <class Type>
LinkedList<Type>::Node* LinkedList<Type>::FindNode(Type _value)
{
Node* q = first;
while(q != NULL && q->value != _value)
q = q->next;
return q;
}