#include<graphics.h> #include<stdio.h> int main(void) { int gdriver = DETECT,gmode; int x=200, y=200; initgraph(&gdriver, &gmode, "c:\\tc\\bgi"); outtextxy(x,y,"Hello World"); closegraph(); }
Explanation :
outtextxy(x,y,"Hello World");
- This Function is Similar to Printf Statement.
- Printf Prints Text on Screen in "Text Mode" while outtextxy() function Prints Text onto Screen in "Graphics Mode".
- This Function Accepts 3 Parameters.
outtextxy(X_Co-ordinate,Y_Co-ordinate,"Text");
Parameter | Explanation |
X_Co-ordinate | Specifies X Co-ordinate |
Y_Co-ordinate | Specifies Y Co-ordinate |
Text | String/Text to be Printed On the Specified Co-ordinates |
1 comments:
How do i print to a new line using this as "\n" isn't working
char *a;
a="Hello\nTest";
settextstyle(3,0,2);
outtextxy(100,20,a);
gives
Hello Test
Post a Comment
Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email