Prototype: extern char * strtok (char * s, char * delim );
Usage: # include
Function: Splits a string into a group of tag strings. S is the string to be decomposed, and delim is the separator string.
NOTE: For the first call, s must point to the
The following illustration is taken from the latest Linux kernel 2.6.29, indicating that the strtok () function is no longer used, instead of strsep (), which is faster.
/**Linux/lib/string. c** Copyright (c) 1991,199 2 LinusTorvalds*//** Stupid
Document directory
1. One application instance
2. strtok_r and Its Usage
3. Source Code of strtok and strtok_r
(1) I have introduced some precautions for using the strtok function. This article introduces an application of strtok and
Strtok and strtok_r
Prototype: char * strtok (char * s, char * delim );Function: Splits a string into a group of strings. S is the string to be decomposed, and delim is the separator string.Note: during the first call, s points to the
Strtok and Strtok_r
Prototype: Char *strtok (char *s, char *delim);Function: Decomposes a string into a set of strings. S is the string to be decomposed, Delim is the delimiter string.Description: On first call, S points to the string
Strtok and strtok_r
Prototype: char * strtok (char * s, char * delim );Function: Splits a string into a group of strings. S is the string to be decomposed, and delim is the separator string.Note: during the first call, s points to the
Copyright NOTICE: This article is the original article, without the owner's permission to reprint.
Directory (?) [+]Considerations for the use of Strtok functions 1. Function prototype and its basic application The Strtok function is used to
The advantages are:
1. You can define multiple separators at once. When the function is executed, it is cut by a single delimiter rather than by the entire delimiter, while the explode is cut by the entire separator string. As a result, explode can
Function Name: strtokFunction: searches for words separated by the delimiters specified in the second string.Usage: char * strtok (char * str1, char * str2 );Program example:# Include # Include Int main (void){Char input [16] = "abc, d ";Char * p;/*
PHP strtok () function instance application. Compared with explode (), the strtok () function can control the pace. Cut strings as needed. The advantage is: 1. Multiple separators can be defined at a time. When a function is executed, the strtok ()
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.