You are here

getmaxx function in c

getmaxx function returns the maximum X coordinate for current graphics mode and driver.

Declaration: int getmaxx();

C program for getmaxx

  1. #include<graphics.h>
  2. #include<conio.h>
  3.  
  4. main()
  5. {
  6.    int gd = DETECT, gm, max_x;
  7.    char array[100];
  8.    
  9.    initgraph(&gd,&gm,"C:\\TC\\BGI");
  10.  
  11.    max_x = getmaxx();
  12.  
  13.    sprintf(array, "Maximum X coordinate for current graphics mode and driver = %d.",max_x);
  14.    outtext(array);
  15.    
  16.    getch();
  17.    closegraph();
  18.    return 0;
  19. }