I can't find anything online about making a linked list with individual nodes that hold arrays.
struct node{
string list[];
string var;
node* next = NULL;
node* previous = NULL;
};
void insertion(node*& start, string name, string words[]){
node* temp = new node;
temp->var = name;
temp->list = words;
if (!start) {
start = temp;
return;
} else {
node* tail = start;
while(tail->next) {
tail=tail->next;
}
tail->next = temp;
temp->previous = tail;
}
The code above gives me the error:
web.cpp: In function ‘void insertion(variable*&, std::__cxx11::string, std::__cxx11::string*)’: web.cpp:18:16: error: incompatible types in assignment of ‘std::__cxx11::string* {aka std::__cxx11::basic_string*}’ to ‘std::__cxx11::string [0] {aka std::__cxx11::basic_string [0]}’ temp->list = words;