Quote Originally Posted by kristineinah View Post
The code below is for my project in my subject which is c++.
Please use code tags when posting code. The code you posted is practically unreadable without code tags.
The code works fine but it seems like the output is inconsistent and weird.
How can the program be "fine", but at the same time the output is "inconsistent and weird"? The program is either working correctly or it isn't working correctly.
Would you please help me think of a solution to this error?
You never mentioned what the error is. In addition, you can solve your own problems with the program by debugging the code and seeing where the problems originate. The Visual C++ compiler comes with one of the best debuggers ever made for C++ programmers. Debugging is part and parcel of learning how to write programs.
I tried to research and read books about this issue
Why are you doing all of that, when the solution is to debug your program and fix the errors?

Regards,

Paul McKenzie