登录
首页 » C/C++ » strtok

strtok

于 2013-05-06 发布 文件大小:4KB
0 76
下载积分: 1 下载次数: 7

代码说明:

  strtok(char s[], const char *delim) 用来将字符串分割成一个个片段。参数s指向欲分割的字符串,参数delim则为分割字符串中包含的所有字符。当strtok()在参数s的字符串中发现参数delim中包涵的分割字符时,则会将该字符改为 字符。在第一次调用时,strtok()必需给予参数s字符串,往后的调用则将参数s设置成NULL。每次调用成功则返回指向被分割出片段的指针。(strtok- break down a string into tokens (ANSI) A sequence of calls to this routine breaks the string into a sequence of tokens, each of which is delimited by a character from the string . The first call in the sequence has as its first argument, and is followed by calls with a null pointer as their first argument. The separator string may be different from call to call. The first call in the sequence searches for the first character that is not contained in the current separator string. If the character is not found, there are no tokens in and strtok() returns a null pointer. If the character is found, it is the start of the first token. strtok() then searches from there for a character that is contained in the current separator string. If the character is not found, the current token expands to the end of the string pointed to by , and subsequent searches for a token wil)

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 696518资源总数
  • 104228会员总数
  • 45今日下载