I've seen some other posts have the same question; However the other posts recommended using strcpy(). The problem is that I am using strcpy() and I am still getting this error. I would really appreciate it if someone could help me out on this one. Ill post my structure and the code that I am having trouble with.
struct movie {
struct movie* next;
struct actor* actors;
char name[100];
int rating;
genre type;
}*list = NULL;
struct actor {
struct actor* next;
char name[100];
};
// Here is the code block i am having troubles with
int add_actor(char* movie_name, char* actor_name)
{
struct movie *temp = list;
struct movie *actor = (struct movie *) malloc(sizeof(struct movie));
while (temp != NULL)
{
if ((strcmp(temp->name, movie_name) == 0))
{
strcpy(list->actors->name, actor_name);
return 1;
}
temp = temp->next;
}
return 0;
}