现在的位置: 首页 > 综合 > 正文

字符串分割

2014年08月07日 ⁄ 综合 ⁄ 共 230字 ⁄ 字号 评论关闭

#include<stdio.h>
#include<string.h>

int main(void)
{
 char str[1024] = {"yang#seng#wb#jfdfdf#yangseng#11111"};
 char *cc;
 cc = strtok(str,"#");
 while(1)
 {
  if(cc == NULL)
   break;
  else
   printf("%s\n",cc);  
  cc=strtok(NULL,"#");

 }
 return 0;
 
}

抱歉!评论已关闭.