Language in C Interview Questions and Answers
Question: How do I programmatically delete lines in the text window?
Answer: While writing programs that perform screen-based I/O, you may want to-delete the current line's contents, moving one line up, all of the output that follows. In such cases a function called delline( ) can be used. Following code snippet illustrates the use of function delline( ).#include <conio.h> main( ) { int i ; clrscr( ) ; for ( i = 0; i <= 23; i++ ) printf ( "Line %drn", i ) ; printf ( "Press a key to continue : " ) ; getch( ) ; gotoxy ( 2, 6 ) ; for ( i = 6; i <= 12; i++ ) delline( ) ; getch( ) ; } |
Is it helpful?
Yes
No
Most helpful rated by users:
- What will be the output of the following code?
void main ()
{ int i = 0 , a[3] ;
a[i] = i++;
printf ("%d",a[i]) ;
} - Why doesn't the following code give the desired result?
int x = 3000, y = 2000 ;
long int z = x * y ; - Why doesn't the following statement work?
char str[ ] = "Hello" ;
strcat ( str, '!' ) ; - How do I know how many elements an array can hold?
- How do I compare character data stored at two different memory locations?