C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_GENRE 10
typedef enum Genre {
ACTION = 1, COMEDY,
DRAMA, HORROR,
ROMCOM, ROMANCE,
HISTORY, ANIME,
THRILLER, SCIFI
} Genre;
typedef struct Film {
char *movieTitel;
int releaseYear;
Genre genre[MAX_GENRE];
struct Film *next;
} Film;
struct Film *create(char *titel, int year, Genre gen[], int genreCount) {
Film *film = malloc(sizeof(Film));
if(film == NULL) return NULL;
film->movieTitel = malloc(strlen(titel)+1);
strcpy(film->movieTitel, titel);
film->releaseYear = year;
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run