I've been working on a Sudoku program these past couple of weeks, and I almost have it complete. I'm just experiencing one last problem. In my program there is a menu that prompts the user if they'd like to display the game board, edit a square, show possible values and quit and save the game. The program works fine up until the quit and save case.
It comes out like this
> > E
> What are the coordinates of the square: B2
>
> What is the value at 'B2': 9
>
>
Q
When it should come out like this
> > E
> What are the coordinates of the square: B2
>
> What is the value at 'B2': 9
>
> > Q
I'm been going over my code for a few hours now, and just can't figure what's wrong. I was hoping to get a fresh pair of eyes to look at it.
Here is the function for this part of the program.
You have a good intention, but I can not see anything wrong with the function that you have posted.
What needs to be seen is any function that comes from choosing "Q" starting with the "getSaveFilename" function and any function that is called from there.
The problem is that you get focused on one part of the program thinking that the problem is there when it is three functions away and you did not consider that because your focus was in the wrong place. It is like compiler error messages, The message will point to a line number that is a problem, but it is actually the line above where the problem starts.
I realize you may not want to post your entire code yet and that is OK I understand, but you do need to show the functions that are involved in writing to a file.
Sometimes the little things are the hardest to see. You want your screen to display this:
> > E
> What are the coordinates of the square: B2
>
> What is the value at 'B2': 9
>
> > Q
If this is what you are looking for than say so on line 10 cout << "> "; the prompt should be: cout <<">> ";. If that is not what you need than I need more to go on.