Explaining :- clrscr (); and getch(); in C
74
clrscr (); and getch();
clrscr(); and getch(); requires the header file conio.h i.e #include <conio.h>
clrscr(); :- This is use to clear the output screen i.e console
suppose you run a program and then alter it and run it again you may find that the previous output is still stucked there itself, at this time clrscr(); would clean the previous screen.
One more thing to remember always use clrscr(); after the declaration like
int a,b,c;
float total;
clrscr();
getch(); :- getch is used to hold the screen in simple language, if u dont write this the screen
will just flash and go away....
PrintShare it! — Rate it: up down flag this hub
Comments
Good explanation; also note that conio.h is not ANSI or ISO standard.
thanks brother i was forget it.
:)
Thanks man.












priyankmaniar says:
8 months ago
i hope it helps. . !