C语言函数大全(e开头)
函数名:ecvt
函数:将浮点数转换为字符串
用法:charecvt (double value,int ndigit,int * decpt,int * sign);
程序示例:
# include
# include
# int main(void)
{
char * string;
双值;
int dec,sign
int ndig = 10;
clrscr();
value = 9.876;
string = ecvt(value,ndig,&dec,& sign);
printf(" string = % s dec = % d \
sign = % d \ n ",string,dec,sign);
value =-123.45;
ndig = 15;
string = ecvt(value,ndig,&dec,& sign);
printf(" string = % s dec = % d sign = % d \ n ",
string,dec,sign);
值= 0.6789e5/*科学
符号*/
ndig = 5;
string = ecvt(value,ndig,&dec,& sign);
printf(" string = % s dec = % d \
sign = % d \ n ",string,dec,sign);
返回0;
}
0条评论