strchr() 字符查找
6、字符串操作函数--strchr()
void test06()
{
char str[] = “hello world”;
printf("%s\n", str);
//需求:找出所有的’l’并将’l’替换成’*’
char ret = NULL;
while((ret=strchr(str,‘l’)) && (ret=’’) );
/

while (1)
{
char ret = strchr(str, ‘l’);
if (ret != NULL)
{
//ret就是’l’的地址
ret = '’;
}
else
{
break;
}
}
/
printf("%s\n", str);
}

相关文章:

  • 2021-11-27
  • 2021-04-29
  • 2021-12-12
  • 2021-12-12
  • 2021-11-30
  • 2021-12-28
  • 2021-05-31
  • 2021-07-09
猜你喜欢
  • 2021-12-12
  • 2021-12-09
  • 2021-11-13
  • 2021-10-11
  • 2021-12-12
  • 2021-12-12
  • 2021-10-17
  • 2021-08-22
相关资源
相似解决方案