If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Need to print out number of words and lines in a file

When I removed that from the header, it could no longer figure out what cin and cout are. As I said, I've very little knowledge of C++ and am quite furious, if more with the instructor for daring to give us the difficult assignment, especially as this isn't a C++ course even, than with anyone else.

I cooled down a bit and was able to eliminate some of the errors. Actually, there is most definitely a legal include like:

Re: Need to print out number of words and lines in a file

Re: Need to print out number of words and lines in a file

Originally Posted by jedipenguin

Still not making sense.

What's wrong?

What did you get out of that example you saw at the link? Comparing it to your code, what is different about that example?

Honestly, you're not taking your time and look at the clear examples that I posted from that website. The examples show that getline() is a member of the stream class. Second, it shows how to use it. The "cin" is the stream, so what is your stream? Isn't it "file" in your example?

If you get this thing to compile, can you imagine what happens if you try to run it and it doesn't produce the results you want?

Re: Need to print out number of words and lines in a file

Another reason I'm so angry is because if something goes wrong, it's likely I could only get a 60&#37; at best, which I'm taking as a personal insult from the professor. And I feel that that is far too low a grade for all the time I'm spending, hence my anger and impatience.

You should also have had a small, simple, test program that just opens a file, and reads until the end. Then when you get that working, you concentrate on the other aspects of the program. Trying to get 10 things to work at the same time, and the basics are still not working is not the way to complete assignments.

Also, making small test programs makes asking questions here easier for you. You now know what doesn't work, and the question becomes more targeted, as opposed to "my program doesn't work and here is all of my code".