std::strtok
Da cppreference.com.
![]() |
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Elemento definito nell'header <cstring>
|
||
char* strtok( char* str, const char* delim ); |
||
Trova il prossimo token in una stringa con terminazione null byte puntato da
str
. I caratteri separatori sono identificati da stringa con terminazione null byte puntato da delim
.Original:
Finds the next token in a null-terminated byte string pointed to by
str
. The separator characters are identified by null-terminated byte string pointed to by delim
.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.
Se str != NULL, la funzione di ricerca per il primo carattere che non separatore. Questo personaggio è l'inizio del token. Allora la funzione ricerca per il carattere primo separatore. Questo personaggio è la fine della token. Funzione termina e restituisce NULL se fine
str
si incontra prima della fine della token viene trovato. In caso contrario, un puntatore alla fine della token viene salvato in una posizione statica per chiamate successive. Questo carattere viene successivamente sostituito da un NULL caratteri e la funzione restituisce un puntatore all'inizio del gettone.Original:
If str != NULL, the function searches for the first character which is not separator. This character is the beginning of the token. Then the function searches for the first separator character. This character is the end of the token. Function terminates and returns NULL if end of
str
is encountered before end of the token is found. Otherwise, a pointer to end of the token is saved in a static location for subsequent invocations. This character is then replaced by a NULL-character and the function returns a pointer to the beginning of the token.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.
Se str == NULL, la funzione continua da dove si era nella chiamata precedente. Il comportamento è lo stesso se il puntatore precedentemente memorizzato viene passato come str.
Original:
If str == NULL, the function continues from where it left in previous invocation. The behavior is the same as if the previously stored pointer is passed as str.
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.
Indice |
[modifica] Parametri
str | - | puntatore alla stringa con terminazione null byte da tokenize
Original: pointer to the null-terminated byte string to tokenize The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
delim | - | puntatore alla stringa con terminazione null byte che identifica delimitatori
Original: pointer to the null-terminated byte string identifying delimiters 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
Puntatore all'inizio di un token se la fine della stringa non è stato rilevato. In caso contrario, restituisce NULL.
Original:
Pointer to the beginning of a token if the end of string has not been encountered. Otherwise returns NULL.
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.
[modifica] Nota
La funzione non è thread-safe.
Original:
The function is not thread safe.
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.
[modifica] Esempio
Output:
A bird came down the walk
[modifica] Vedi anche
C documentation for strtok
|