freopen
Aus cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody>| definiert in Header <stdio.h>
|
||
FILE *freopen( const char *filename, const char *mode, FILE *stream ); |
||
Weist eine vorhandene Datei Stream
stream auf eine andere Datei filenameusing angegebenen Modus identifiziert. mode wird verwendet, um die neue Datei Zugriff Modus zu bestimmen . Original:
Reassigns an existing file stream
stream to a different file identified by filenameusing specified mode. mode is used to determine the new file access mode. The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Parameter
| filename | - | Dateinamen, um die Datei-Stream zu assoziieren
Original: file name to associate the file stream to The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mode | - | null-terminierte Zeichenkette Festlegung neuer File Access Modus
Original: null-terminated character string determining new file access mode
The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stream | - | der Datei-Stream zu ändern
Original: the file stream to modify The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Rückgabewert
stream bei Erfolg NULL im FehlerfallOriginal:
stream on success, NULL on failureThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Beispiel
Der folgende Code leitet
stdout in einer Datei
Original:
The following code redirects
stdout to a file
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
#include <stdio.h>
int main()
{
printf("stdout is printed to console");
freopen("redir.txt", "w", stdout);
printf("Stdout is redirected to a file");
fclose(stdout);
}
Output:
stdout is printed to console
Siehe auch
öffnet eine Datei Original: opens a file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (Funktion) | |
schließt eine Datei Original: closes a file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (Funktion) | |
C++ documentation for freopen
| |