gotoxy

 

See also Example Portability

 

Syntax

 

#include <conio.h>

void gotoxy(int x

int y);

 

Description

 

Positions cursor in text window.

gotoxy moves the cursor to the given position in the current text window. If the coordinates are in any way invalid the call to gotoxy is ignored. An example of this is a call to gotoxy(40,30) when (35,25) is the bottom right position in the window. Neither argument to gotoxy can be zero.

Note: Do not use this function for Win32s or Win32 GUI applications.

 

Return Value

 

None.

 

Borland C++ 5.0 Programmer's Guide

 

--------------------------------------------------------------------------------------------------------------------------------

 

/* gotoxy example */

 

#include <conio.h>

 

int main(void)

{

clrscr();

gotoxy(35, 12);

cprintf("Hello world");

getch();

return 0;

}

 

 

 

Borland C++ 5.0 Programmer's Guide

 

--------------------------------------------------------------------------------------------------------------------------------

 

clrscr

 

See also Example Portability

 

Syntax

 

#include <conio.h>

void clrscr(void);

 

Description

 

Clears the text-mode window.

clrscr clears the current text window and places the cursor in the upper left corner (at position 1,1).

 

Note: Do not use this function for Win32s or Win32 GUI applications.

 

Return Value

 

None.

 

Borland C++ 5.0 Programmer's Guide

 

-------------------------------------------------------------------------------------------------------------------------------

 

cprintf

 

See also Example Portability

 

Syntax

 

#include <conio.h>

int cprintf(const char *format[, argument, ...]);

 

Description

 

Writes formatted output to the screen.

cprintf accepts a series of arguments, applies to each a format specifier contained in the format string pointed to by format, and outputs the formatted data directly to the current text window on the screen. There must be the same number of format specifiers as arguments.

For details details on format specifiers, see printf Format Specifiers.

The string is written either directly to screen memory or by way of a BIOS call, depending on the value of the global variable _directvideo.

 

Unlike fprintf and printf, cprintf does not translate linefeed characters (\n) into carriage-return/linefeed character pairs (\r\n). Tab characters (specified by \t) are not expanded into spaces.

 

Note: Do not use this function for Win32s or Win32 GUI applications.

 

Return Value

 

cprintf returns the number of characters output.

 

Borland C++ 5.0 Programmer's Guide

 

--------------------------------------------------------------------------------------------------------------------------

 

getch

 

See also Example Portability

 

Syntax

 

#include <conio.h>

int getch(void);

 

Description

 

Gets character from keyboard, does not echo to screen.

getch reads a single character directly from the keyboard, without echoing to the screen.

 

Note: Do not use this function for Win32s or Win32 GUI applications.

 

Return Value

 

getch returns the character read from the keyboard.

 

Borland C++ 5.0 Programmer's Guide

 

--------------------------------------------------------------------------------------------------------------------------