S'il vous plait est-ce que quelqu'un peut m'aider à déterminer pourquoi ce programme "se plante" lors de l'exécution.? Merci, ça sera très gentil...
#include<stdio.h>
#include<malloc.h>
#include<conio.h>
#include<string.h>
struct liste
{
char *mot ;
struct liste * next;
};
typedef struct liste LISTE;
/***********************************/
void inserer(LISTE **f, char *m )
{
LISTE *p;
p=(LISTE*)malloc(sizeof(LISTE));
p->mot=m;
p->next=*f;
*f=p;
}
/***********************************/
LISTE * creerliste()
{
LISTE *first=NULL;
char *mo;
strcpy(mo,"mot");
while(memcmp("x",mo,1))
{
printf("\n introduire mot: \n");
gets(mo);
inserer(&first,mo);
}
return(first);
}
/***********************************/
int main()
{
creerliste();
getch();
return(0);
}
NB: J'utilise Dev-C++