QSopt QSget_objname QSopt > Callable Library > Function List
  QSopt
  Downloads
  LP Info
  Software
  Problem Formats
  Callable Library
  Overview
Function List
  Rational Solver
  Beta
  Contact Info
Purpose
Copy the objective name.
Synopsis
char* QSget_objname (QSprob p)
Arguments
p a handle to an initialized problem.
Returns
A pointer to a string specifying the name of the objective for the problem. The function returns NULL if an error occurred.
Description

The pointer returned by QSget_objname is a handle to a string that is allocated in the function. When the string is no longer needed, the memory should be freed by the user; since the memory for the string is allocated by the QSopt library, the memory must be freed with a call to QSfree and not by the system free() function. (Note that without the call to QSfree , the QSopt library will not free the memory for the string, even after a call to QSfree_prob(p).

Example
char *objname;

/* p is an initialized QSprob */

objname = QSget_objname (p);
if (objname == (char *) NULL) {
    fprintf (stderr, 
             "Could not obtain the objective name for the LP\n");
} else {
    printf ("Objective Name: %s\n", objname);
    QSfree (objname);  /* Use QSfree for mem allocated by QSopt */
}
 
QSopt | Problem Formats | Downloads Back
Last Updated: November 2003