我在这条线上遇到了问题 c->next=var;
我的职责是:
{
struct film
{
int id;
char nom[50];
char typeFilm[50];
int duree;
int dateSortie;
struct film *next;
};
#include<stdio.h>
#include<string.h>
#include "structure_film.h"
#include<stdlib.h>
void ajouter_film(struct film **h,struct film **c)
{
struct film *var;
int s, genre;
do
{
var=(struct film*) malloc(sizeof(struct film));
printf("quel est le nom du film que vous voulez ajouter ? \n");
scanf("%s",var->nom);
printf("\nquel est le type de ce film \n 1-action \n 2-aventure \n 3-romantique \n 4-comedie \n");
scanf("%d",&genre);
switch(genre)
{
case 1 : …Run Code Online (Sandbox Code Playgroud) c ×1