QSopt QSget_probname 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 problem name.
Synopsis
char* QSget_probname (QSprob p)
Arguments
p a handle to an initialized problem.
Returns
A pointer to a string specifying the name of the problem. The function returns NULL if an error occurred.
Description

The pointer returned by QSget_probname 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 *name;

/* p is an initialized QSprob */

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