Salut,
Question s�rement stupide mais, je n�arrive pas depuis ce matin � afficher un texte � .txt � dans IDC_EDIT1 (Edit Control)
Mon probl�me, c�est le retour � la ligne et la d�tection de la fin du fichier.
Dans le fichier test.txt :
0 0 0
0 1 1
1 0 1
1 1 0
et le programme :
merci beaucoup
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 char temp[800]; int i=0; char c; const char* fichier; fichier="test.txt"; FILE* fp = NULL; fp = fopen(fichier,"r"); while (( c=fgetc(fp)) !=EOF) { //if(c=='\0') temp[i++]='\r\n'; temp[i++]=c; } if(fp) fclose(fp); SetWindowText(GetDlgItem(hdlg,IDC_EDIT1),temp);
@+
Partager