I am trying to do an assignment where my code will count a letter inputted from a sentence. The code now only examines the first word and not the entire sentence.
I also get an error, the error started when I added the getLine function.
In function 'int main()':
14:19: error: no matching function for call to 'std::basic_istream<char>::getline(char&)'
14:19: note: candidates are:
In file included from /usr/include/c++/4.9/iostream:40:0,
#include <iostream>
#include <string>
using namespace std;
int countLetters(char, char[]);
int main()
{
char let;
char text[256];
int getLine();
On line 13 of your program you use cin.getline(let);
To find one character, you would want to use cin.get(let);
I also noticed that you have the "getLine" function at the end of the program that is never called upon. However, this function also returns 0 which would terminate your program if it was called upon.
Are you allowed to use strings instead of char for this assignment?