I have a list of numbers that looks like this: 1.234D+1or 1.234D-02. I want to read the file using C. The function atofwill simply ignore Dand translate only the mantissa.
The function fscanfwill not accept the format '%10.6e', because it expects Einstead Dexponentially.
When I ran into this problem in Python, I gave up and just used string substitution before converting from string to float. But in C, I'm sure there must be a different way .
So, how would you read a file with numbers, using Dinstead Efor scientific notation? Please note that I do not mean how to read the lines yourself, but rather how to convert them to float.
Thank.
source
share