如何编程实现在tmemo中查找指定的字符串
2018-11-26 · 百度知道合伙人官方认证企业
关注
展开全部
#include
#include
int main(void)
{
char string[17];
char *ptr, c ;
scanf("%c",&c);
strcpy(string, "This is a string");
ptr = strchr(string, c);
if (ptr)
printf("The character %c is at position: %d\n", c, ptr-string);
else
printf("The character was not found\n");
return 0;
}
#include
int main(void)
{
char string[17];
char *ptr, c ;
scanf("%c",&c);
strcpy(string, "This is a string");
ptr = strchr(string, c);
if (ptr)
printf("The character %c is at position: %d\n", c, ptr-string);
else
printf("The character was not found\n");
return 0;
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询