gotoxy function >> conio.h header file >> Move Cursor to Specified PositionPritesh
Basic You Should know ?
Header File : conio.h
Function : gotoxy
Return Type : Void
- Positions cursor in text window .
- Moves Cursor to Position Specified i.e at (x,y)
- If the coordinates are invalid, the call to gotoxy is simply ignored by Compiler
- The origin is located at (1,1) the upper-left corner of the window
- Maximum x Co-ordinate in Text Mode = 80.
- Maximum y Co-ordinate in Text Mode = 25.
void gotoxy(int x, int y);
- x represents “New X Co-ordinate”
- y represents “New Y Co-ordinate”
Care Should be Taken :gotoxy(50,15);
- In the Above Example You will unable to see expected Output instead Output will be printed at position (1,16) because of leading Newline Character (n) in printf
Example of invalid coordinates:
gotoxy(40,30) /* (35,25) = window's bottom right position */