An illustrative code example in C using the input parsing API is shown below (and is also available in the examples directory from a top-level install). This C example is configured to parse the example pecos-input.txt file shown here and uses many of the available parsing routines including a demonstration of default value registration.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int igot;
float reyn,mach,aoa,A[3];
int iter_max,turbulent;
char *gridfile;
char *koomie;
char *key1, *key2;
printf("--> %-10s = %f\n","reyn",reyn);
printf("--> %-10s = %f\n","mach",mach);
printf("--> %-10s = %f\n","aoa",aoa);
printf("--> %-10s = %i\n","iter_max",iter_max);
printf("--> %-10s = %s\n","gridfile",gridfile);
free(gridfile);
printf("--> %-10s = %i\n","turbulent",turbulent);
printf("--> %-10s = %s \n","solver/keyword 1",key1);
printf("--> %-10s = %s \n","solver/keyword 2",key2);
printf("--> %-10s = %f %f %f\n","turbulence/A",A[0],A[1],A[2]);
printf("--> %-10s = %s\n","koomie",koomie);
free(koomie);
printf("--> %-10s = %s\n","koomie",koomie);
free(koomie);
printf("\n ------ Full Dump ------\n\n");
printf(" ---- End Full Dump ----\n\n");
printf("\n ------ Full Dump (delimited) ------\n\n");
printf(" ---- End Full Dump ----\n\n");
printf("\n ------ Full Dump to test.out ------\n\n");
printf(" ------- End Full Dump -------\n\n");
int igot2;
float fgot;
double dgot;
char *sgot;
printf("registered int = %i\n",igot2);
printf("registered float = %f\n",fgot);
printf("registered double = %e\n",dgot);
printf("registered string = %s\n",sgot);
printf("fread_int: fast_button = %i\n",igot);
fgot=-1.;
dgot=-1.;
printf("fread_float: afloat = %f\n",fgot);
printf("fread_double: adouble = %e\n",dgot);
sgot=NULL;
printf("fread_char: astring = %s\n",sgot);
return 0;
}