Using C++, how can we precisely display text/strings on the screen exactly where we want to?
I am writing a very long C++ program, of course by making use of my own functions or sub routines, to make a game. I have this particular scenerio in question here:
Code:
Menu Options
[1] New
[2] Open
[3] View All
[4] Go to Main Menu
Select your choice [1/2/3/4]:
The pieces of text shown above are displayed in colors on the user screen having background color as well. The problem arises when we select the option# 4 which simply returns control to the parent Menu. The presented screen is removed and the previous one is displayed. But the text then is not displayed precisely in the center of the screen. The menu options are bottom aligned as if they were being pushed up from the bottom.
Note: I am using to output the texts.
Can you show me a better way to accomplish the task?
Please, also note that whenever an option is selected the presented screen is to be removed and another screen is to be shown on the user screen.
There is one more problem to it, when an option number is entered via keyboard, it is not displayed just infront of the prompt:
Code:
Select your choice [1/2/3/4]:
Instead, it is put arbitrarily anywhere which seems to be crazy.
N.B.: Platform: Windows XP (DOS Console)