📄 program6_07.c
字号:
/* Program 6.7 A demonstration of seeking and finding */
#include <stdio.h>
#include <string.h>
int main(void)
{
char str1[] = "This string contains the holy grail.";
char str2[] = "the holy grail";
char str3[] = "the holy grill";
/* Search str1 for the occurrence of str2 */
if(strstr(str1, str2) == NULL)
printf("\n\"%s\" was not found.", str2);
else
printf("\n\"%s\" was found in \"%s\"",str2, str1);
/* Search str1 for the occurrence of str3 */
if(strstr(str1, str3) == NULL)
printf("\n\"%s\" was not found.", str3);
else
printf("\nWe shouldn't get to here!");
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -