Namensräume
Varianten

gets, gets_s

Aus cppreference.com
< c‎ | io

 
 
File input/output
Funktionen
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Dateizugriff
Original:
File access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Direkte Eingabe / Ausgabe
Original:
Direct input/output
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
fread
fwrite
Unformatierte Eingang / Ausgang
Original:
Unformatted input/output
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Formatierte Eingabe / Ausgabe
Original:
Formatted input/output
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Datei Positionierung
Original:
File positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ftell
fgetpos
fseek
fsetpos
rewind
Fehlerbehandlung
Original:
Error handling
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
clearerr
feof
ferror
perror
Operationen auf Dateien
Original:
Operations on files
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
remove
rename
tmpfile
tmpnam
 
definiert in Header <stdio.h>
char*gets(char*str );
char*gets_s(char*str, rsize_t n);
(Seit C11)(optional)
1)
Liest stdin in die Felder, auf die str bis ein Zeilenumbruch gefunden wird oder End-of-Datei auftritt. A
Original:
Reads stdin into the character array pointed to by str until a newline character is found or end-of-file occurs. A
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Nullzeichen unmittelbar nach dem letzten Zeichen in das Array zu lesen geschrieben .
Original:
null character is written immediately after the last character read into the array.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Liest höchstens n-1 Zeichen aus stdin in das Array, auf das str bis new-line Zeichen, End-of-File-Bedingung oder Lesefehler. Ein NULL-Zeichen wird sofort nach dem letzten Zeichen in das Array zu lesen geschrieben, oder str[0], wenn keine Zeichen gelesen wurden .
Original:
Reads at most n-1 characters from stdin into the array pointed to by str until new-line character, end-of-file condition, or read error. A null character is written immediately after the last character read into the array, or to str[0] if no characters were read.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
@ @ If n Null oder größer ist als RSIZE_MAX, ein Null-Zeichen wird str[0] geschrieben, aber die Funktion liest und verwirft Zeichen aus stdin bis new-line Zeichen, End-of-File-Bedingung, oder lesen Sie Fehler .
Original:
@@ If n is zero or is greater than RSIZE_MAX, a null character is written to str[0] but the function reads and discards characters from stdin until new-line character, end-of-file condition, or read error.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
@ @ If n-1 Zeichen gelesen wurden, liest weiter und verwirft die Zeichen aus stdin bis new-line Zeichen, End-of-File-Bedingung, oder lesen Sie Fehler .
Original:
@@ If n-1 characters have been read, continues reading and discarding the characters from stdin until new-line character, end-of-file condition, or read error.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
@ @ Die gets_s Funktion ist eine Erweiterung und ist optional. Es wird garantiert, dass nur vorhanden, wenn __STDC_LIB_EXT1__ definiert ist .
Original:
@@ The gets_s function is an extension and is optional. It is guaranteed to be present only if __STDC_LIB_EXT1__ is defined.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Inhaltsverzeichnis

[Bearbeiten]Parameter

str -
Zeichenkette geschrieben werden soll
Original:
character string to be written
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten]Rückgabewert

str bei Erfolg NULL anders
Original:
str on success, NULL otherwise
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten]Notes

Die gets() Funktion führt keine Überprüfung der Grenzen, ist daher diese Funktion extrem anfällig für Buffer-Overflow-Attacken. Es kann nicht sicher verwendet werden (es sei denn, das Programm läuft in einem Umfeld, das, was man auf stdin erscheinen beschränkt). Aus diesem Grund wurde die Funktion in der dritten Berichtigung wurde der C99-Standard veraltet und ganz in der C11-Standard entfernt. fgets() und gets_s() sind die empfohlenen Ersatz .
Original:
The gets() function does not perform bounds checking, therefore this function is extremely vulnerable to buffer-overflow attacks. It cannot be used safely (unless the program runs in an environment which restricts what can appear on stdin). For this reason, the function has been deprecated in the third corrigendum to the C99 standard and removed altogether in the C11 standard. fgets() and gets_s() are the recommended replacements.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Verwenden Sie niemals gets() .
Original:
Never use gets().
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten]Siehe auch

liest formatierten Eingaben von stdin, eine Datei-Strom oder einen Puffer
Original:
reads formatted input from stdin, a file stream or a buffer
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(Funktion)[edit]
erhält eine Zeichenkette aus einem Datei-Stream
Original:
gets a character string from a file stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(Funktion)[edit]
schreibt eine Zeichenkette in einer Datei-Stream
Original:
writes a character string to a file stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(Funktion)[edit]
close