📄 fig16_28.cpp
字号:
// Fig. 16.28: fig16_28.cpp
// Using strchr
#include <iostream.h>
#include <string.h>
int main()
{
char *string = "This is a test";
char character1 = 'a', character2 = 'z';
if ( strchr( string, character1 ) != NULL )
cout << '\'' << character1 << "' was found in \""
<< string << "\".\n";
else
cout << '\'' << character1 << "' was not found in \""
<< string << "\".\n";
if ( strchr( string, character2 ) != NULL )
cout << '\'' << character2 << "' was found in \""
<< string << "\".\n";
else
cout << '\'' << character2 << "' was not found in \""
<< string << "\"." << endl;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -