11-05-01-2.cpp

来自「more efftive 代码」· C++ 代码 · 共 22 行

CPP
22
字号
#include <iostream>#include <cstring>#include <cctype>#include <algorithm>using namespace std;inline bool eq_nocase(char c1, char c2) {  return toupper(c1) == toupper(c2);}int main(){  const char* s1 = "This is a Test";  const char* s2 = "This is a test";  const int N = strlen(s1);    if (equal(s1, s1 + N, s2, eq_nocase))    cout << "Equal" << endl;  else    cout << "Not equal" << endl;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?