Bonjour,
Donc voila Fgets ne marche plus a chaque fois que j'exécute tout s'arrête pourquoi??
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
29
30
31
void Copy_NewMsg_In_File (Message *msg)
{
	FILE *f = NULL;
	FILE *fc = NULL;
	f = fopen("C:\\glomosim\\glomosim\\network\\DataPacket.txt", "wb");
	if (f == NULL)
    {
		printf("Impossible d'ouvrir le fichier DataPacket.txt");
    }
    else
    {
		fprintf(f, "%s", msg->packet);
		printf("\n avant packet = %s\n", msg->packet); 
		main_LZW();
		fc = fopen("C:\\glomosim\\glomosim\\network\\test.out", "rb");
		if (fc == NULL)
		{
			printf("Impossible d'ouvrir le fichier test.out");
		}
		else
		{
			fgets(msg->packet, 100, fc);
//packet est de type char*
                    //peut être parce que fc  contient moins que 100 caractères!! 
			fclose(fc);
		}	
		fclose(f);
    }//else
   printf("\n packet = %s\n", msg->packet);// ici il affiche packet= 
                                                          //et hop tout s'arrête
}
S.V.P,
si seulement vous me dite ou se trouve l'erreur
merci d'avance