查找 字符 索引

 

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

int main ()
{
   const char str[] = "http://www.runoob.com";
   const char ch = '.';
   char *ret;

   ret = strchr(str, ch);

   printf("|%c| 之后的字符串是 - |%s|\n", ch, ret);
   
   return(0);
}

 

posted @ 2019-09-06 23:44  anobscureretreat  阅读(210)  评论(0编辑  收藏  举报