Sign in to follow this  
Xeneth

How do I reset the curser?

Recommended Posts

In the consol, in C++, What is the commands to reset the curser back to the top left? That way, when I'm writing the next peragraph, it will write over what is already there. Also, is there a way to lock the scrolling in the consol so if there are to many char, the top line willnot go off screen.

Share this post


Link to post
Share on other sites
Quote:

In the consol, in C++, What is the commands to reset the curser back to the top left? That way, when I'm writing the next peragraph, it will write over what is already there.


You can use SetConsoleCursorPosition () function

Quote:

Also, is there a way to lock the scrolling in the consol so if there are to many char, the top line willnot go off screen


If you're overwriting the console buffer using SetConsoleWindowInfo () and SetConsoleActiveScreenBuffer (), they won't be scrolled.

Hth
V@T

Share this post


Link to post
Share on other sites
Quote:
Original post by Xeneth
This is in basic c++, not .net or windows. Just the dos console the comes up with the basic cout.
If you aren't going to include any windows headers, the system("CLS") command is your only method for resetting the cursor; it clears the console and moves the cursor back to the upper left. There is AFAIK no method for any of the others you mentioned without using Windows-specific functionality.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this