int QSget_colnames (QSprob p, char **colnames)
/* p is an initialized QSprob, a handle to an existing LP problem */ int rval, ncols, j; char **colnames; ncols = QSget_colcount (p); colnames = (char **) malloc (ncols * sizeof (char *)); rval = QSget_colnames (p, colnames); if (rval) { fprintf (stderr, "Could not get column names, error code %d\n", rval); } else { printf ("Variable Names\n"); for (j = 0; j < ncols; j++) { printf ("%s\n", colnames[j]); } /* Need to free the individual names */ for (j = 0; j < ncols; j++) { /* Use QSfree for mem allocated by QSopt */ QSfree (colnames[j]); } } /* Use free for mem allocated by system malloc */ free (colnames);