Hello everyone,
I have a beginner question, im sure the answer will be a stupid simple thing...
I just would like to turn this into cpp:
1 2 3 4 5 6 7 8 9 10
string eg("azertyFTW");
if(eg[one of the letters contained in this string] == 'c')
{
cout << "eg has the letter c in it";
}
else
{
cout << "not this time :(";
}
Here it is :)
He hope someone has got my answer ;)
Thanks
#include <string>
#include <iostream>
usingnamespace std;
int main()
{
string eg("azertyFTW");
if (eg.find('c') != string::npos)
cout << "eg has the letter c in it";
else
cout << "not this time :(";
return 0;
}