int QSget_columns_list (QSprob p, int num, int *collist,
    int **colcnt, int **colbeg, int **colind, double **colval,
    double **obj, double **lower, double **upper, char ***names)
/* p is an initialized QSprob, a handle to an existing LP problem  */
/* Obtain the column information for column 2.                     */

double *colval = NULL, *obj = NULL, *lower = NULL, *upper = NULL;
int *colcnt = NULL, *colbeg = NULL, *colind = NULL;
char **names = NULL;
int collist[1] = { 2 };
int k, rval;

rval = QSget_columns_list (p, 1, collist, &colcnt, &colbeg, &colind,
                           &colval, &obj, &lower, &upper, &names);
if (rval) {
    fprintf (stderr, "could not obtain column, error code %d\n", rval);
} else {
    printf ("Variable %s, objective %f, bounds %f <= %s <= %f\n",
             names[0], obj[0], lower[0], names[0], upper[0]);
    printf ("Coefficients: ");
    for (k = colbeg[0]; k < colbeg[0] + colcnt[0]; k++) {
        printf ("Row %d = %f  ", colind[k], colval[k]);
    }
    printf ("\n");
}

QSfree (colcnt); QSfree (colbeg); QSfree (colind); QSfree (colval);
QSfree (obj);
QSfree (lower); QSfree (upper);
if (names) {
    QSfree (names[0]);
    QSfree (names);
}