99re热这里只有精品视频,7777色鬼xxxx欧美色妇,国产成人精品一区二三区在线观看,内射爽无广熟女亚洲,精品人妻av一区二区三区

strtok

2018-11-11 16:05 更新

 原型:extern char *strtok(char *s, char *delim);
       
 用法:#include <string.h>
 
 功能:分解字符串為一組標(biāo)記串。s為要分解的字符串,delim為分隔符字符串。
 
 說明:首次調(diào)用時(shí),s必須指向要分解的字符串,隨后調(diào)用要把s設(shè)成NULL。
       strtok在s中查找包含在delim中的字符并用NULL('\0')來替換,直到找遍整個(gè)字符串。
       返回指向下一個(gè)標(biāo)記串。當(dāng)沒有標(biāo)記串時(shí)則返回空字符NULL。
 
 舉例:


     // strtok.c
     
     #include <syslib.h>
     #include <string.h>
     #include <stdio.h>
     main()
     {
       char *s="Golden Global View";
       char *d=" ";
       char *p;
       
       clrscr();
       
       p=strtok(s,d);
       while(p)
       {
         printf("%s\n",s);
         strtok(NULL,d);
       }
       getchar();
       return 0;
     }      


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)