std::strtok
De 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. |
Déclaré dans l'en-tête <cstring>
|
||
char* strtok( char* str, const char* delim ); |
||
Trouve le jeton suivant dans une chaîne d'octets terminée par zéro pointé par
str
. Les caractères de séparation sont identifiés par une chaîne d'octets terminée par zéro pointé par 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.
Si str != NULL, la fonction recherche pour le premier caractère qui n'est pas séparateur. Ce caractère est le début de la' jeton. Ensuite, la fonction recherche pour le caractère premier séparateur. Ce personnage est la fin de la' jeton. Fonction termine et renvoie NULL si la fin de
str
est rencontrée avant la fin de la' token est trouvé. Sinon, un pointeur vers la fin de la' jeton est enregistré dans un emplacement fixe pour les appels suivants. Ce personnage est alors remplacée par une valeur NULL caractères et la fonction retourne un pointeur vers le début de la' jeton .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.
Si str == NULL, la fonction reprend là où il a quitté l'invocation précédente. Le comportement est le même que si le pointeur précédemment mémorisée est passé comme 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.
Sommaire |
[modifier] Paramètres
str | - | pointeur vers la chaîne d'octets terminée par NULL pour tokenizer
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 | - | pointeur vers la chaîne d'octets terminée par NULL identifier délimiteurs
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. |
[modifier] Retourne la valeur
Pointeur vers le début d'un jeton, si la fin de la chaîne n'a pas été rencontrée. Sinon retourne 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.
[modifier] Note
La fonction n'est pas 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.
[modifier] Exemple
Résultat :
A bird came down the walk
[modifier] Voir aussi
C documentation for strtok
|