How to align output to the top of the console?

Mar 30, 2015 at 9:50pm
At the start of my program, my menu looks like this: http://i.imgur.com/OhWUcum.png

But when I do a do while loop to repeat the program in addition to using a ClearScreen function (just a bunch of new lines) it looks like this: http://i.imgur.com/Km1vpaz.png

Adding or reducing \n doesn't seem to make any difference. I would like the second pic to look like the first pic to where there is no space above the menu.

Thank you! If you need to see code just ask.
Mar 30, 2015 at 10:53pm
As you can see in these pictures

Your first program - http://gyazo.com/a5dce2720ee3c41c1b3cc96827030c2c

After clearing screen - http://gyazo.com/b6036b01e1abf365bb72332af151e319

Look at the thing that you can use to scroll up and down. It clears your screen, but it doesnt add any additional new lines like you think. It simply clears it, and continues from there.
Mar 30, 2015 at 11:34pm
Did you just tell me to use the scrollbar? Lol. Sorry, I'm not sure of what you're trying to say / explain.

My new line function looks like this.

1
2
3
4
void ClearScreen() // FUNCTION TO PRINT 15 NEW LINES.
    {
    cout << string( 15, '\n' );
    }
Last edited on Mar 30, 2015 at 11:39pm
Mar 31, 2015 at 5:05am
How about you reduce/increase new lines (trial and error) and see what fits you?
Mar 31, 2015 at 6:17am
Yes, scrollbar. You can just use the scrollbar to adjust the menu in the second picture.
Mar 31, 2015 at 7:27am
Mar 31, 2015 at 7:32am
Actualy... I assume you're on windows. You can actually just do system("cls"); And that will clear your your screen, and do exactly what you asked for here, making the menu in the second picture look like the one from the first.
Apr 1, 2015 at 12:13am
@Programmer007, If you read my OP. I stated that it doesn't seem to make a difference.

@TarikNeaj, using the scrollbar is not the fix I'm looking for for getting my menu aligned.

@TarikNeaj (your last post), cool. I'll try that!

(EDIT): system("cls") works, just the solution I was looking for. Thank you.
Last edited on Apr 1, 2015 at 12:21am
Topic archived. No new replies allowed.