29 lines
384 B
C
29 lines
384 B
C
|
#include <stdio.h>
|
||
|
#include <errno.h>
|
||
|
|
||
|
int show_a_double (double x) {
|
||
|
|
||
|
printf(">> double: %09.15f\n", x);
|
||
|
|
||
|
}
|
||
|
|
||
|
int usage(char *progname) {
|
||
|
|
||
|
char *str;
|
||
|
|
||
|
printf("usage: %s <double-value>\n", progname);
|
||
|
exit(ENOTSUP);
|
||
|
|
||
|
}
|
||
|
|
||
|
int checkargs(int argc, char *argv[]) {
|
||
|
|
||
|
double darg = 0.0;
|
||
|
|
||
|
if (argc != 2) usage((char *const) argv[0]);
|
||
|
else darg = atof(argv[1]);
|
||
|
|
||
|
return darg;
|
||
|
|
||
|
}
|