#include<stdio.h> typedef struct { int x; int y; } point; int main(void) { FILE* f; point p; f = fopen("sauverPoints.bin", "rb"); if (f = = NULL) printf ("Erreur ..."); else { fread(&p, sizeof(point),1,f); while (!feof(f)) { printf("Un point lu (%d,%d)\n", p.x,p.y); fread(&p, sizeof(point),1,f); } } fclose(f); } |
REMARQUE
|