Problem bei einer printf-Anweisung
-
Hi,
habe folgendes geschrieben:int store(char *datName, Ergebnis *e){
FILE *pfile=fopen("ergebnis.txt", "w");
if(!pfile){
printf("what a fuck", "ergebnis.txt");
return 0;
}
fprintf(pfile,"MaxX = P(%f,%f)\nMinX = P(%f,%f)\nMaxY = P(%f,%f)\nMinY = P(%f,%f)",
e->pxMax->x,e->pxMax->y,e->pxMin->x,e->pxMin->y,e->pyMax->x,e->pyMax->y,e->pyMin->x,e->pyMin->y);
fclose(pfile);
return 1;
}
das problem ist, das ich nicht verstehe, was auch nicht von mir ist, weshalb ich
"fprintf(pfile,"MaxX = P(%f,%f)\nMinX = P(%f,%f) ... " am Anfang das "pfile" schreibe????
Freue mich auf Antworten und Hilfe!!!
-
Falsches Forum. Das gehört eher ins C-Forum.
Aber dennoch hier:
http://www.cplusplus.com/reference/clibrary/cstdio/fprintf/Das ist ein Handle für das File, in das geschrieben werden soll.
-
Und wenn es doch C++ sein soll, dann noch der allgemeine Hinweis, Streams zu benutzen:
http://www.c-plusplus.net/forum/viewtopic-var-t-is-244091-and-start-is-11.html
http://magazin.c-plusplus.net/artikel/Ein- und Ausgabe in CPlusPlus - IO-Streams