int x = 10; string s = "hello world"; for (int i = 0; i < x; i++) { if (s[i] == 'l') { cout << "found an l!" << endl; } }