M
Marcus Jacobs
Dear Group
I have written a file conversion program that uses strtof to convert
text strings to floats. It works as I intended except for my error
messages. It is my understanding that strtof returns the converted
value if the conversion is successful a "0" upon failure. When this
conversion fails, my program sends an error message to my error.log
file. The problem with this is there are times when strtof converts a
text string such as "0.000000" to a float. The conversion is
successful but when the program goes to test whether or not the
conversion is successful, since the returned value is equal to "0" it
send out an error message. This can happen hundreds if not thousands
of times. Because of this, it is not feasible to check all of the
messages to see if the conversion failed. Does anyone have any ideas
as to how I can test for a successful strtof conversion for my
situation.
Regards
Marcus D. Jacobs
I have written a file conversion program that uses strtof to convert
text strings to floats. It works as I intended except for my error
messages. It is my understanding that strtof returns the converted
value if the conversion is successful a "0" upon failure. When this
conversion fails, my program sends an error message to my error.log
file. The problem with this is there are times when strtof converts a
text string such as "0.000000" to a float. The conversion is
successful but when the program goes to test whether or not the
conversion is successful, since the returned value is equal to "0" it
send out an error message. This can happen hundreds if not thousands
of times. Because of this, it is not feasible to check all of the
messages to see if the conversion failed. Does anyone have any ideas
as to how I can test for a successful strtof conversion for my
situation.
Regards
Marcus D. Jacobs