For a exercise I must make a programm which counts how many times a word is being inputted. It's a exercise from chapter 3 of Accelerated C++
So i thought this will work :
But I get a problem with the for loop.
using namespace std ;
// ask for and read the words to count
cout << "Enter all the words, "
"followed by end-of-file: ";
vector<int> words_count ;
int found, place, teller=0 ;
string x ;
while (cin >> x)
for (teller ; words.begin(); words.end())
if (x == words[teller] then
found = "1"
place = teller
if found==1 then
words_count [place]+=1 ;
found = 0 ;
for (teller; words.begin();words.end())
cout << "Word" << words [teller] << "komt" << words_count[teller] << "voor";
Who can help me and tell me what's wrong with this line.