Program with c-string functions

I'm having trouble with my programming assignment

These are the instructions http://voyager.deanza.edu/~bentley/cis22b/ass4.html


Can anyone give me a (detailed) step-by-step algorithm to solving this problem?
Your program specs tell you what you should do. Is there anything in particular you're unclear about?
I'm mainly stuck trying to read each line from the text file into a char array.

I tried to use getline, but it only works with string, not char.
I tried to use getline, but it only works with string, not char.

There are two getline() functions one that works with std::string one that works with C-strings you need to use the proper version depending on whether you're using C-strings or std::string.

http://www.cplusplus.com/reference/string/string/getline/
http://www.cplusplus.com/reference/istream/istream/getline/

Or since this is really a C program in disguise you could use fgets() instead.

http://www.cplusplus.com/reference/cstdio/fgets/

Topic archived. No new replies allowed.