Witam ma taki oto problem chce przeszukać jednego dłuższego stringa czy występuje w nim krótszy .
napisałem taki o to kod
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
bool szukaj(string tab,string wyr)
{
bool v=false;
for(int k=0;k<tab.size()-1;k++){
if(tab.at(k)==wyr)
v=true;
}
return v;
}
int main()
{
string abc="abc";
string jk="a";
if(szukaj(abc,jk)==true)
cout<<"yes"<<true;
system("PAUSE");
return EXIT_SUCCESS;
}
i podczas kompilacji wyrzuca mi taki oto błąd : match for 'operator==' in '(&tab)->std::basic_string<_CharT, _Traits, _Alloc>::at [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>](((unsigned int)k)) == wyr'