i am using 'atof' function to convert string into double but it shows the correct value if the string length is 17(max). is ther any function if string length is more than 17?

Recommended Answers

All 4 Replies

Does the string represent a valid double value? If not, then you won't find a conversion function that works without first getting a library that supports larger floating point values.

the string contains only the numerals from 0-9.

That's only a partial test. A string can contain only digits and still be out of range for the target type. If it's out of range, trying to convert the string to the target type will be undefined.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.