Namespace
Varianti

gets, gets_s

Da cppreference.com.
< c‎ | io

 
 
File input/output
Funzioni
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Accesso ai file
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.
Diretta input / output
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
Ingresso formattato / uscita
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.
Formattato di input / output
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.
File di posizionamento
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
La gestione degli errori
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
Le operazioni sui file
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
 
Defined in header <stdio.h>
char *gets( char *str );
char *gets_s(char *str, rsize_t n);
(dal C11)(opzionale)
1)
Legge stdin nella matrice di caratteri puntato da str fino a quando un carattere di nuova riga viene trovato o end-of-file di verifica. 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.
carattere null viene scritto subito dopo l'ultimo carattere letto nella matrice.
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)
Legge a personaggi più n-1 dal stdin nell'array puntato da str fino al carattere di nuova riga, end-of-file di condizione, o errore di lettura. Un carattere null viene scritto subito dopo l'ultimo carattere letto nella matrice, o per str[0] se non sono stati letti i caratteri.
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.
@ @ Se n è zero o è maggiore di RSIZE_MAX, un carattere null viene scritto str[0] ma la funzione legge e scarta i caratteri da stdin fino al carattere di nuova riga, end-of-file di condizione, o errore di lettura.
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.
@ @ Se i caratteri n-1 sono stati letti, continua a leggere e scartando i caratteri da stdin fino al carattere di nuova riga, end-of-file di condizione, o errore di lettura.
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.
@ @ La funzione gets_s è un'estensione ed è opzionale. E 'garantito per essere presente solo se __STDC_LIB_EXT1__ è definito.
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.

Indice

[modifica] Parametri

str -
stringa di caratteri da scrivere
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.

[modifica] Valore di ritorno

str in caso di successo, altrimenti NULL
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.

[modifica] Note

La funzione gets() non esegue il controllo dei limiti, pertanto, questa funzione è estremamente vulnerabile agli attacchi di buffer overflow. Non può essere utilizzato in modo sicuro (a meno che il programma viene eseguito in un ambiente che limita ciò che può apparire sul stdin). Per questo motivo, la funzione è stata sconsigliata a corrigendum terzo lo standard C99 e rimosso del tutto nello standard C11. fgets() e gets_s() sono le sostituzioni raccomandazioni.
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.
Non gets() usare.
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.

[modifica] Vedi anche

legge l'input formattato da stdin, un flusso di file o di un buffer
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.

(funzione) [edit]
ottiene una stringa di caratteri da un flusso di file
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.

(funzione) [edit]
Scrive una stringa di caratteri in un flusso di file
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.

(funzione) [edit]