Here is the header file
class sv1{
private:
struct Node{
string title;
Node* next;
};
public:
void InsertAfter(Node **head, string title);
void getMetadata(string t);
void q_folder(string t_q);
This is how the cc file will be
void sv1::getMetadata(string t)
{
Node *head=NULL;
title=t;
q_folder(title);
}
void sv1::q-folder(string t_q)
{
InsertAfter(&head,t_q);
}
void sv1::insertAfter(Node **head,string title)
{
if (head==NULL)
{
Node* temp=NULL;
temp=new Node;
temp->title=title;
*head=temp;
}
else{
Node *temp= new Node;
temp= new Node;
temp->title=title;
temp->next=(*head)->next;
(*head)->=temp;
}
}
The error says that the head is not declared in the function q_folder. What causes that and how do I solve it?