I am trying to get rid of the error in my program. I'm not sure what is wrong with the array.
Here is the sample code:
typedef struct listNoNodes
{
char FirstName[50];
char LastName[60];
int ID;
int age;
struct listNoNodes* next;
} listNoNodes;
listNoNodes* listNodes(char FirstName[], char LastName[], int ID, int age,
listNoNodes* next)
{
listNoNodes* tmp = (listNoNodes*)malloc(sizeof(listNoNodes));
tmp->FirstName[50] = FirstName;
tmp->LastName[60] = LastName;
tmp->ID = ID;
tmp->age = age;
tmp->next = next;
return tmp;
};
Here is the error
lab3.c: In function ‘listNodes’:
lab3.c:21:21: warning: assignment to ‘char’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
21 | tmp->FirstName[50] = FirstName;
| ^
lab3.c:22:20: warning: assignment to ‘char’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
22 | tmp->LastName[60] = LastName;