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.
精彩评论