So in the following code I am supposed to write a statement that declares a variable named default of type Item and initialize it with the following strings for its title, author, and year members to: "title", "author", and "1950".
#include <stdio.h>
#define SIZE 50
struct book {
char title[SIZE], author[SIZE], year[5];
};
typedef struct book Item;
typedef struct node {
Item item;
struct node * next;
} Node;
typedef Node * List;
int main(void){
Node Node1, Node2;
List pNode = &Node2;
return 0;
}
But I am quite new to linked lists and I can't seem to find a way to do this in one statement? Maybe I am misreading the question somehow? I feel like the answer to this is very simple but I just can't grasp even the concept of linked lists for some reason anyways.
Thanks for any help anyone!
stdin, prints the words contained in the list, and then properly frees all memory associated with the list and exits.