CPXXgeterrorstring and CPXgeterrorstring
The routine CPXXgeterrorstring/CPXgeterrorstring returns an error message
string corresponding to an error code.
CPXCCHARptr CPXXgeterrorstring( CPXCENVptr env, int errcode, char * buffer_str )
CPXCCHARptr CPXgeterrorstring( CPXCENVptr env, int errcode, char * buffer_str )
Description
The routine CPXXgeterrorstring/CPXgeterrorstring returns an error message
string corresponding to an error code. Error codes are returned by CPLEX
routines when an error occurs.
This routine allows the CPLEX environment argument to be NULL so
that errors caused by the routine
CPXXopenCPLEX/CPXopenCPLEX
can be translated.
Arguments
- env
-
A pointer to the CPLEX environment as returned by
CPXXopenCPLEX/CPXopenCPLEX. - errcode
- The error code to be translated.
- buffer_str
-
A character string buffer. This buffer must be at least
CPXMESSAGEBUFSIZEcharacters to hold the error string and the terminatingNULcharacter.
Return
This routine returns a pointer to the argument buffer_str if the string
exists. In that case, buffer_str
contains the error message string.
It returns NULL if the error code does not have a corresponding string.
Example
char buffer[CPXMESSAGEBUFSIZE];
char *errstr;
errstr = CPXgeterrorstring (env, errcode, buffer);
if ( errstr != NULL ) {
printf ("%s \n", buffer);
}
else {
printf ("CPLEX Error %5d: Unknown error code. \n",
errcode);
}