I am trying to understand how [bool hasaletter(string, char(c))] works. after boolhasaletter appears, if it is true, i want to add to total_num.
I have tried if(true) {
and it did not work.
so basically, im trying to see if a string has a character user inputted.
int main()
{
int total_num
char c;
ifstream infile("data.txt");
string a_word[2];
cout << "enter a letter";
cin >> c;
while(infile >> a_word)
{
bool hasaletter(string, char (c));
// what needs to be in this line????
++total_num; //if the above statement is true i want to add 1 to total_num
return 0;
}