What is the standard way to parse floats at runtime in C?
Posted
by Joel J. Adamson
on Stack Overflow
See other posts from Stack Overflow
or by Joel J. Adamson
Published on 2010-04-12T15:00:25Z
Indexed on
2010/04/12
15:03 UTC
Read the original article
Hit count: 254
Hello, I have a scientific application for which I want to input initial values at runtime. I have an option to get them from the command line, or to get them from an input file. Either of these options are input to a generic parser that uses strtod to return a linked list of initial values for each simulation run. I either use the command-line argument or getline() to read the values.
The question is, should I be rolling my own parser, or should I be using a parser-generator or some library? What is the standard method? This is the only data I will read at runtime, and everything else is set at compile time (except for output files and a few other totally simple things).
Thanks,
Joel
© Stack Overflow or respective owner