This code which you see the below is part of my project. When I compile this code , I get the error.Error is "passing argument 1 of 'strcpy' from incompatible pointer type" and expected 'char ' but argument is of type 'char *'.How can I fix this ? Thank you.
struct songs
{
char name[MAX];
double length;
struct songs *next;
};
typedef struct songs songs;
struct albums
{
char title[MAX];
int year;
char singerName[MAX];
songs *bas;
songs *current;
struct albums *next;
};
void add(char albumTitle[],char singerName[], int releaseYear )
{
struct albums *temp;
temp=(struct albums *)malloc(sizeof(struct albums));
strcpy( temp->title, albumTitle ); /* ERROR */
temp->year=releaseYear;
strcpy( temp->singerName, singerName ); /* ERROR */
if (head== NULL)
{
curr=head=temp;
head->next=NULL;
curr->next=NULL;
}
else
{
curr->next=temp;
curr=temp;
}
printf("Done\n");
}