Having a problem with assigning a string in this linked list, any ideas?
the line that reports an error is highlighted in red.
I would expect this to work as variable 'name' is a char array and i am simply assigning the string "Vin" to it.
#include<stdlib.h>
#include<stdio.h>
typedef struct // TV Guide entry struct declaration
{
char name[50];
char day[10];
int time;
}Entry;
typedef struct LinkedListNode // LinkedListNode declaration
{
Entry* entry; // Points to Entry struct
struct LinkedListNode* next; // Points to the next node
}LinkedListNode;
typedef struct // LinkedList declaration
{
int listLength;
LinkedListNode* head; // Points to first node of linkedlist
}LinkedList;
void createList() // Creates an empty linkedlist
{
LinkedList* entryList;
entryList = (LinkedList*)malloc(sizeof(LinkedList));
entryList -> head = NULL;
entryList -> listLength = 0;
}
void insertFirst( LinkedList* entryList )
{
LinkedListNode* newNode;
newNode = (LinkedListNode*)malloc(sizeof(LinkedListNode));
newNode -> entry -> name = "Vin"; // <- NOT WORKING!
newNode -> next = entryList -> head;
}