Winbatch, I have another Q for you. I have the whole project compiling but I am stuck with displaying all the Customer details from the Q. I can pass the Class Object "Tim" to the Queue with various details but I need to write these to a file when I quit the program.

I can read in from a file and insert into the Queue but I am having difficulty printing out all the details of the Queue. As you can see I have tryed to use a method call ShowAll in the Qclass but I am unfortunately getting nowhere.

Also and this is no doubt probably the easiest Q you will ever get. When I run the prog it will work perfectly so long as I do not leave spaces between my name. e.g. Enter name: TimMurphy but if I leave a space
eg Enter name: Tim Murphy then I encounter problems. I know the solution to this is "getline" but that has not worked either.

Any help would be greatly appreciated.



13 Years
Discussion Span
Last Post by winbatch


This shouldn't compile - look at this line in main.cpp

while((!in_file.eof())and (name != "")){

Even if it didn't compile, you try and read from the file if it it couldn't be opened... (Your cout says that a new file is created, I don't think that's true of an ifstream..) and even if it were, what would be the point of reading from an empty file?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.