Das folgende Programm soll einfach nur ein paar Zahlen in die Datei ausgabe.txt schreiben:
------------------------------------------------------------------------------------------
/* Programm.c */
#include <stdio.h>
int main (void)
{
int i;
File * Ausgabe;
Ausgabe = fopen("ausgabe.txt","w");
for (i = 1; i == 1000; i++)
{
fprintf(Ausgabe, "%d",i);
}
fclose(Ausgabe);
}
------------------------------------------------------------------------------------------
Aufruf des gcc ergibt, dass der Typ FILE * unbekannt ist.
Das kann ich nicht verstehen. In jedem Lehrbuch steht, dass FILE *ein Zeiger auf
eine Struktur ist, die den Dateizugriff ermöglicht:
[axel@localhost Dateiooperationen]$ gcc Programm.c
Programm.c: In function `main':
Programm.c:6: `File' undeclared (first use in this function)
Programm.c:6: (Each undeclared identifier is reported only once
Programm.c:6: for each function it appears in.)
Programm.c:6: `Ausgabe' undeclared (first use in this function)
Ich währe froh, wenn mir jemand weiterhelfen könnte.
Gruß
Axel
Anfängerfrage: Dateizugriff, gcc (Mandrake8.2) Typ File ist unbekannt.
Re: Anfängerfrage: Dateizugriff, gcc (Mandrake8.2) Typ File ist unbekannt.
Es muss FILE heißen, nicht File.
Das ist heute nicht mein Tag.
Gruß
Axel
Das ist heute nicht mein Tag.
Gruß
Axel