libftsh
A Fast Transform for Spherical Harmonics
|
Retrieve command line options. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Functions | |
char * | getoption (const char *flag, int argc, char **argv) |
Retrieve command line options.
char* getoption | ( | const char * | flag, |
int | argc, | ||
char ** | argv | ||
) |
This routine allows command line options, usually of the form: program -d 256. Normal usage in the program is:
if(getoption("-d",argc,argv)!=NULL) degree=atoi(getoption("-d",argc,argv));
The first call makes sure the option flag was indeed used. If it was, we call again to get the value as a string, then convert it using ato_ .