Outtextxy() Function

outtextxy() function just like the outtext() function used to display the string on the screen but the main difference between the outtext() function and outtextxy() function is that outtext() function displays the string at current position but outtextxy() function display the string at particular location (X,Y).

Declaration

void outtextxy(int x, int y, char *string);
  • outtextxy() function conatins three parameters x, y and string.
  • x and y specifies the x-coordinate and y-coordinate. (x,y) specifies that location where we want to display our string.
  • Parameter string specifies the string which is going to be display on the screen.
  • For better understanding go through the program:

Program

#include<stdio.h>

#include<conio.h>

#include<graphics.h>

void main()

{

int gd=DETECT, gm;

initgraph(&gd,&gm," ");

outtextxy(30,100,"C graphics programming is too interesting");

getch();

closegraph();

}

Above program will display the message "C graphics programming is too interesting" at position (30,100) on the screen by using outtextxy() function.

Output

c graphics