#include <iostream>
#include <string>
int main (void){
using namespace std;
string STR =("TEST");
const std::string::size_type STR_SIZE = STR.size();
int count =0;
while ( count <= STR_SIZE){
if (STR[count]= ('E')){
cout <<"FOUND letter E at"<<" "<< count<<endl;
}
count++;
}
return 1;
}
output:
FOUND letter E at 0
FOUND letter E at 1
FOUND letter E at 2
FOUND letter E at 3
FOUND letter E at 4
Some thing wrong with "if (STR[count]= ('E')"
I would like to have the output as:
FOUND letter at 1
Please give me some hints .
Thanks,