简体   繁体   中英

Reading in long double in the C programming language

我怎么读C中的长双?

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.

您可以使用格式说明符%ld来读取长双变量。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM