Clear part of the screen

Is there any way I can clear only a selected part of the screen? (I'm aware of system("cls"))

For example, when you enter a date, and is wrong, could it just errase that input and only say "Wrong try again" without errasing everything else you where doing?


In this case, a function that only errases what is in the while

while(not wrong)
{
cout<<"DIA: ";
cin>>obj.dia;
cout<<"MES: ";
cin>>obj.mes;
cout<<"ANIO: ";
cin>>obj.anio;
}


PS: Also, is there any whay in which you can ask the user to enter the date DD/MM/YYY?
Last edited on
I just went over this in another thread: http://www.cplusplus.com/forum/beginner/146607/

You can use the SetConsoleCursorPosition() function to move the cursor wherever you want, then overwrite with spaces.

*edit* this is Windows specific code.
Last edited on
Topic archived. No new replies allowed.