User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







c:graphics.h:grapherrormsg

grapherrormsg

Syntax of grapherrormsg

#include <graphics.h>
char * grapherrormsg(int errorcode);
 

Description of grapherrormsg

grapherrormsg returns a pointer to the error message string associated
with errorcode, the value returned by graphresult.
Refer to the entry for errno in the Library Reference, Chapter 4, for a
list of error messages and mnemonics.

Example of grapherrormsg

/* grapherrormsg example */
 
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
 
#define NONSENSE -50
 
int main(void)
{
   /* force an error to occur */
   int gdriver = NONSENSE, gmode, errorcode;
 
   /* initialize graphics mode */
   initgraph(&gdriver, &gmode, "");
 
   /* read result of initialization */
   errorcode = graphresult();
 
   /* if an error occurred, then output descriptive error message*/
   if (errorcode != grOk) {
printf("Graphics error: %s\n", grapherrormsg(errorcode));
 
printf("Press any key to halt:");
getch();
exit(1);   /* terminate with an error code */
   }
 
 
   /* draw a line */
   line(0, 0, getmaxx(), getmaxy());
 
   /* clean up */
   getch();
   closegraph();
   return 0;
}

See also

output of grapherrormsg example

  no output of example at the moment
  do not hesitate and add it...  

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
c/graphics.h/grapherrormsg.txt · Last modified: 2015/05/06 23:06 (external edit)

Impressum Datenschutz

Creating directory /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2022 failed
Writing /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2022/misc_data.ser failed
Creating directory /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2022 failed
Writing /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2022/ip.ser failed
Creating directory /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2022 failed
Writing /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2022/pages.ser failed
Creating directory /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2022 failed
Writing /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2022/ua.ser failed
Creating directory /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2022 failed
Writing /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2022/page_users.ser failed