why does this not compile?
std::string test;
std::string tester="integer is a number";
int strlen = tester.length() ;
for(int i = 0; i<strlen-1;i++)
{
test[i]=tester[i];
if(test=="integ er")
{cout<<"integer found!";}
}
I am trying to pull extract individual words from a sentence.
std::string test;
std::string tester="integer is a number";
int strlen = tester.length() ;
for(int i = 0; i<strlen-1;i++)
{
test[i]=tester[i];
if(test=="integ er")
{cout<<"integer found!";}
}
I am trying to pull extract individual words from a sentence.
Comment