double p1 = 3.1415926;write(1,&p1,sizeof(p1));//如何输出小数?

来源:学生作业帮助网 编辑:作业帮 时间:2024/12/02 13:45:06
double p1 = 3.1415926;write(1,&p1,sizeof(p1));//如何输出小数?
x)K/MIU(0TU0341442./,I0Q+0)άJO(0Դީ/M~ھgS7$0,Eav6sX=t>m ~9sӾONfٓ.dn^ܳu]y9Ov.cڳ!ڛ&*yrFbBqIQA,D(3$M(gdk"!PHth$ف Ӿ

double p1 = 3.1415926;write(1,&p1,sizeof(p1));//如何输出小数?
double p1 = 3.1415926;
write(1,&p1,sizeof(p1));//如何输出小数?

double p1 = 3.1415926;write(1,&p1,sizeof(p1));//如何输出小数?
write()函数除去字符串外,任何数据输出你都看不出来(或是看不懂)!
double p1 = 3.1415926;
char str[100];
sprintf(str , "%.7lf" , p1 );
write( 1 , str , strlen(str) );