What error occurs?
Show the actual code, or not just snippets. I can't see what's wrong just from that. I'm still not exactly sure what you want to have happen.
getline works with strings, so if you want to do a character, then just do line[0] like I did above. This gets a char. Or did you mean char*? Two different things.
Your confusion is understandable, C++ template compiler errors are infamously atrocious.
If you search the compiler error output for "required from", it gives you a hint as to where the issue is.
error: no match for 'operator==' (operand types are 'char' and 'const std::basic_string<char>')
Somewhere you're trying to compare a char to a string (basic_string<char>).
f = count(vs.at(i).begin(), vs.at(i).end(), alpha);
vs is a vector<string>.
vs.at(i) is a string.
You're iterating from the beginning of one string to the end of it, which is iterating over characters, but alpha is a string and not a character.
If you require alpha to be 1 character long, do something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
string alpha;
getline (cin, alpha);
if (alpha.length() != 1)
{
std::cout << "Bad input. Enter again, etc.\n";
}
//
int f = 0;
int q = 0;
vector <int> fr;
for(int i = 0; i < r; i++)
{
f = count(vs.at(i).begin(), vs.at(i).end(), alpha[0]);
if (f > 0) {q = f;}
fr.push_back(f);
}
etc. It should compile now, although I don't know if the logic is correct yet.
Also, it helps to use meaningful variable names. I have no idea what f, q, fr means.