You are here

outtext and outtextxy functions

Declarations:
void outtext(char *string);
void outtextxy(int x, int y, char *string);

These functions are used to display text on the screen in graphics mode. Function outtext displays text at the current position while outtextxy displays text at the specified coordinates (x, y) on the screen.

C program

#include<graphics.h>
#include<conio.h>

int main()
{
   int gd = DETECT, gm;
   
   initgraph(&gd,&gm,"C:\\TC\\BGI");
   
   outtext("To display text at a particular position on the screen use outtextxy");
   outtextxy(100, 100, "Hi There");
   
   getch();
   closegraph();
   return 0;
}

Note : Do not use printf, gotoxy and other textmode functions in graphics mode. Do not use escape sequences such as '\n','\t' etc in outtext and outtextxy functions as they are meant to be used in textmode.