开发者

Reading in long double in the C programming language

How do I read in a long double in 开发者_如何学GoC?


long double x; scanf("%Lf", &x);


Be aware that "long double" is a synonym for "double" on Visual Studio.

http://blogs.msdn.com/ericflee/archive/2004/06/10/152852.aspx


Either hrnt's answer (scanf("%Lf", &x)) or

long double x;
if(read(fd,&x,sizeof(x))!=sizeof(x)) printf("Oops\n");

the question is very vague.


you can use the format specifier %ld for reading long double variables.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜