You are here

getmaxx and getmaxy functions in C

Declarations:

int getmaxx();
int getmaxy();

Function getmaxx returns the maximum X coordinate for current graphics mode and driver.
Function getmaxy returns the maximum Y coordinate for current graphics mode and driver.

C programming code

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

int main()
{
   int gd = DETECT, gm, X, Y;
   char a[100];
   
   initgraph(&gd,&gm,"C:\\TC\\BGI");

   X = getmaxx();
   Y = getmaxy();

   sprintf(a, "Maximum X and Y coordinates for current graphics mode and driver are %d and %d respectively.", X, Y);
   outtext(a);
   
   getch();
   closegraph();
   return 0;
}

Share this