English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

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
#include
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

2006-11-26 21:10:00 · 4 answers · asked by Anonymous in Computers & Internet Programming & Design

4 answers

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.

2006-11-26 21:18:30 · answer #1 · answered by Anonymous · 0 0

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();

2006-11-26 21:12:54 · answer #2 · answered by sukumenon 1 · 0 0

Just use clrscr(). This function is defined in conio.h, and you have alreday included this file.

2006-11-26 21:56:12 · answer #3 · answered by manoj Ransing 3 · 0 0

please use this

clrscr();

this is used for clear the screen

2006-11-26 21:29:49 · answer #4 · answered by Sindhu 2 · 0 0

fedest.com, questions and answers