标签类目:strpos

查找指定字符串在另一字符串中的位置(strpos)

分类:C/C++

  1. #include "stdio.h"
  2. int main()
  3. {
  4.      char* str = "linuxany.com";
  5.      printf("pos1:%d\n",strpos(str,"any",1));
  6.      printf("pos2:%d\n",strpos(str,"n",2));
  7.      return 0;
  8. }
  9. //函数定义:取字符串位置,中文作为一个字符计算

继续阅读 »


返回顶部