I am working on my C ++ homework. The goal is to create a function which will check a given file for a particular word, and then return the number of times the word appears in the file back to main. I am stuck, no entirely sure what I am doing wrong, but i haven't dealt with fstreams much yet. It is homework so I don't want an "answer" but just a fresh set of eyes to maybe give a hint as to what I am missing.
H:\cs111\word_search.cpp|12|error: no matching function for call to 'std::basic_ifstream<char>::open(std::string&)'|
is the error message codeblocks gives me
Nice. That does allow it to run, and i am getting the correct numbers, however when aI try to turn it into hypergrade I get E:\temp\76A0.tmp\/word_search.cpp: In function 'int count_the_word(std::string, std::string)':
E:\temp\76A0.tmp\/word_search.cpp:12:29: error: no matching function for call to 'std::basic_ifstream::open(std::string&)'
Yes, this was the problem, ironically I found it seconds before you sent the message. I very much appreciate your time this was becoming very frustrating. It seems to work fine as coded, what kind of problems are you referring to if I don't change it ?
Did you try file I posted?
With some conditions being true, it will report 3 entries of word "food".
(make sure there is an empty line or space at the end of file)