I am trying to set up a loop for a question for my c++ class. Basically, we have to set up a loop on the word Python and break the loop when it gets to h. I am getting this error at the == (error: operand types are incompatible) I got this so far,
string word = "Python";
for(int i = 0; i < word.length(); i++) {
if (word.at(i) == "h") {
break;
}
}
cout << word.at(i) <<endl;
return 0;
}
Can someone take a look at this and let me know what i'm doing wrong?
Just choose "create empty project" or something to that effect when you create the project. And when you add a .cpp file to it, choose "empty file", if applicable.