字符串分割

#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;
 
}

;

Popular Programs