Bill said:
Volume is type int. In my file not strtod. That's really all I
know to use.
Following is a portion of the C standard description. Note that
you can have an int object and load it with strtol, as in:
intobject = strtol(s, *endptr, 10);
without needing casts. So forget atoi.
7.20.1.4 The strtol, strtoll, strtoul, and strtoull functions
Synopsis
[#1]
#include <stdlib.h>
long int strtol(
const char * restrict nptr,
char ** restrict endptr,
int base);
long long int strtoll(
const char * restrict nptr,
char ** restrict endptr,
int base);
unsigned long int strtoul(
const char * restrict nptr,
char ** restrict endptr,
int base);
unsigned long long int strtoull(
const char * restrict nptr,
char ** restrict endptr,
int base);
Description
[#2] The strtol, strtoll, strtoul, and strtoull functions
convert the initial portion of the string pointed to by nptr
to long int, long long int, unsigned long int, and unsigned
long long int representation, respectively. First, they
decompose the input string into three parts: an initial,
possibly empty, sequence of white-space characters (as
specified by the isspace function), a subject sequence
resembling an integer represented in some radix determined
by the value of base, and a final string of one or more
unrecognized characters, including the terminating null
character of the input string. Then, they attempt to
convert the subject sequence to an integer, and return the
result.