Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to convert a string contains only long double number like :
string s = "230.2356666156"; to a long double number , so how can i do so ?
note : i'm not c++11 , and i dont want to cout because i know to cout using setprecision()
any help ?

What I have tried:

i've searched a lot but find nothing
Posted
Updated 5-May-17 22:19pm
v3
Comments
[no name] 5-May-17 12:09pm    
http://www.cplusplus.com/reference/cstdlib/strtold/
nader rihan 5-May-17 12:26pm    
this is for c++11 only
[no name] 5-May-17 12:43pm    
What is for C++ 11 only? The STANDARD functions that are available? They are called STANDARD functions for a reason.
Jochen Arndt 5-May-17 12:56pm    
It has been introduced with C99 (it is a C standard library function).

But if you use the Microsoft compiler you are out of luck:
That does not support the long double type and the existing functions supporting long double behave like the corresponding double function versions.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900