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.

Regards

Tim

Tim,

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.