int QSget_column_index (QSprob p, const char *name, int *colindex)
/* p is an initialized QSprob, a handle to an existing LP problem  */
/* Find the index of the variable z.                               */

int rval, colindex;
const char *name = "z";

rval = QSget_column_index (p, name, &colindex);
if (rval) {
    fprintf (stderr, "could not get index, error code %d\n", rval);
} else {
    if (colindex == -1) {
        printf ("%s is not in the problem\n", name);
    } else {
        printf ("%s is variable number %d\n", name, colindex);
    }
}