All pastes #56884 Raw Edit

Untitled

public c v1 · immutable
#56884 ·published 2006-05-18 14:38 UTC
rendered paste body
#include <popt.h>#include <stdio.h>#include <stdlib.h>char *foo = NULL;int main(int argc, const char *argv[]){        int cur_arg;        poptContext context;        struct poptOption option_table[] =        {                {NULL, 'q', POPT_ARG_STRING, &foo, 0, NULL, NULL},                POPT_TABLEEND        };        context = poptGetContext(NULL, argc, argv, option_table, 0);        while((cur_arg = poptGetNextOpt(context)) >= 0);        poptFreeContext(context);        if(foo != NULL)        {                puts(foo);                free(foo);        }        return 0;}