What function should I use to clear a screen in C? And what is the header file to include?
For example, my code is:
#include %26lt;stdio.h%26gt;
#include %26lt;conio.h%26gt;
main()
{
printf("\nType anything!!!");
printf("\nType anything!!!");
printf("\nType anything!!!");
printf("\nType anything!!!");
getch();
// I want to place the code here that clears the screen...
}
Please help me... Im new in C...ΓΌ. Thanks
Can you help me in C?
Use clrscr(); just after the opening the main function. It works for C++ and it will surely work also for C; I didn't know they are so similar.
Reply:Now that you've included both header files, just use this:
clrscr();
That's the library function for clear screen. If you're on linux use:
system.clear();
Reply:Just use clrscr(). This function is defined in conio.h, and you have alreday included this file.
Reply:please use this
clrscr();
this is used for clear the screen
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment