How To Clear Output Screen In Turbo C++



Hi .
i am using C++ editor to write my C code.
when i press Ctrl+F9 , the output screen comes and goes without stopping for a while.

Please note that i have included '#include<stdio.h>' and i am using 'getchar()' function do stop the screen.

  • 6 Contributors
  • forum9 Replies
  • 6,615 Views
  • 19 Hours Discussion Span
  • commentLatest PostLatest Postby ankur_

Recommended Answers

How To Clear Output Screen In Turbo C++ Hp

Hi .
i am using C++ editor to write my C code.
when i press Ctrl+F9 , the output screen comes and goes without stopping for a while.

  1. I'm uncertain what you mean via dosbox. In case you mean a Command instantaneous which you would be able to run via typing in command after hitting the window key, all you're able to do is click the X go out button on the precise suitable corner, like maximum living house windows. I think of there is a few thing called dosbox that facilitates you to run previous dos video games, wherein case i.
  2. Getch is used to read a character from screen and added just before the program ends. It is a predefined function in header file. To clear the screen, you can also add clrscr; just after the declaration. We’re using the header file and getch to show output on Turbo C, which is our MS-DOS compiler.

It is a predefined function in 'conio.h' (console input output header file) used to clear the console screen. It is a predefined function, by using this function we can clear the data from console (Monitor). Using of clrscr function in C is always optional but it should be place after variable or function declaration only. Clrscr and Getch in C. Clrscr and getch both are predefined function in 'conio.h' (console input output header file). Clrscr It is a predefined function in 'conio.h' (console input output header file) used to clear the console screen. It is a predefined function, by using this function we can clear the data from console (Monitor).

Please note that i have included '#include<stdio.h>' and i am using 'getchar()' function do stop the screen.

How To Clear Output Screen In Turbo C++ Engine

If you …

Jump to Post

If you are using turbo C then use getch() not getchar(). Its in the header file conio.h.

Don't listen to dkalite. getch() is not standard, getchar() is.

As for your problem, my crystal ball tells me your problem is on line 75 of your code... :icon_confused:

Jump to Post

for windows getch and getchar can be used using the header file <conio.h>
In linux for the same you require <stdlib.h>

Not quite. getchar() is declared in <stdlib.h>, which is a standard header so every compiler will have it. getch() is typically declared in <conio.h>, but only on some Windows …

How To Clear Output Screen In Turbo C++Jump to Post

All 9 Replies

Hi .
i am using C++ editor to write my C code.
when i press Ctrl+F9 , the output screen comes and goes without stopping for a while.

Please note that i have included '#include<stdio.h>' and i am using 'getchar()' function do stop the screen.

How To Clear Screen

If you are using turbo C then use getch() not getchar(). Its in the header file conio.h.