getmaxx() function in C Last Updated : 25 Jan, 2018 Comments Improve Suggest changes Like Article Like Report The header file graphics.h contains getmaxx() function which returns the maximum X coordinate for current graphics mode and driver. Syntax : int getmaxx(); Below is the implementation of getmaxx() function: C // C Implementation for getmaxx() #include <graphics.h> #include <stdio.h> // driver code int main() { // gm is Graphics mode which is // a computer display mode that // generates image using pixels. // DETECT is a macro defined in // "graphics.h" header file int gd = DETECT, gm; char arr[100]; // initgraph initializes the // graphics system by loading a // graphics driver from disk initgraph(&gd, &gm, ""); // sprintf stands for “String print”. // Instead of printing on console, it // store output on char buffer which // are specified in sprintf sprintf(arr, "Maximum X coordinate for current " "graphics mode And driver = %d", getmaxx()); // outtext function displays text at // current position. outtext(arr); getch(); // closegraph function closes the // graphics mode and deallocates // all memory allocated by // graphics system . closegraph(); return 0; } Output : Comment S Sahil_Bansall Follow Improve S Sahil_Bansall Follow Improve Article Tags : Misc C Language computer-graphics c-graphics Explore C BasicsC Language Introduction6 min readIdentifiers in C3 min readKeywords in C2 min readVariables in C4 min readData Types in C5 min readOperators in C8 min readDecision Making in C (if , if..else, Nested if, if-else-if )7 min readLoops in C6 min readFunctions in C6 min readArrays & StringsArrays in C6 min readStrings in C6 min readPointers and StructuresPointers in C9 min readFunction Pointer in C6 min readUnions in C4 min readEnumeration (or enum) in C5 min readStructure Member Alignment, Padding and Data Packing8 min readMemory ManagementMemory Layout of C Programs5 min readDynamic Memory Allocation in C7 min readWhat is Memory Leak? How can we avoid?2 min readFile & Error HandlingFile Handling in C11 min readRead/Write Structure From/to a File in C3 min readError Handling in C8 min readUsing goto for Exception Handling in C4 min readError Handling During File Operations in C5 min readAdvanced ConceptsVariadic Functions in C5 min readSignals in C language5 min readSocket Programming in C8 min read_Generics Keyword in C3 min readMultithreading in C9 min read Like