#include <iostream> #include <cstring> using namespace std; void searchCenzur() { char str[80] = "lsasacsalolcassalolasclolcascaslol"; int j = 0; for(int i = 0; i < 80; i++) { if(str[i] == "l") { if(str[i+1] == "o") { if(str[i+2] == "l") { j++; } } } } cout << "количество совпадений: " << j << endl; } int main() { searchCenzur(); return 0; } error main.cpp: 14: 27: error: ISO C ++ forbids comparison between pointer and integer [-fpermissive]
str[i]is a character."l"is a string. - VladD September'a', not"a"(this is how they write strings that are represented in memory by a sequence of characters ending in binary zero) - avp