When ever I try to compile my program it gives me an error at tempNode->name = Name; saying
"incompatible types in assignment of `char *' to `char[20]'"
heres some of my code:
Can anyone tell me why its doing this or how to fix it?Code:const int MAX = 20; .................................... private: struct node { char name[MAX]; int age; node* nxt; }; node* Root; node* LastNode; node* tempNode; Data* Data_Ptr; node* tempNode2; ............................................ void List::AddData(char Name[MAX], int Age) { tempNode = new node; tempNode->name = Name; tempNode->age = Age; tempNode->nxt = NULL; .................................................
Thanks!
btw im using dev c++ as my compiler