Saturday 8 October 2011

gotoxy function in C

gotoxy function places cursor at a desired location on screen i.e. we can change cursor position using gotoxy function.
GotoXY is a function or procedure that positions the cursor at (X,Y), X in horizontal, Y in vertical direction relative to the origin of the current window. The origin is located at (1,1), the upper-left corner of the window.

#include<stdio.h>
#include<conio.h>
void main()
{
int i;
printf("This is the first line.\n");
gotoxy(10,4);
printf("This is the second line.\n");
gotoxy(20,8);
printf("And this is line 3.\n");
getch();
}

No comments:

Post a Comment