Category : C Source Code
Archive   : CBIBLE.ZIP
Filename : GCVT.C

 
Output of file : GCVT.C contained in archive : CBIBLE.ZIP
/* gcvt.c, from pp.176-177 of Turbo C Bible */
/* Converts a double-precision floating-point value into a string
using a specified number of significant digits
and having an embedded decimal point. */
#include
#include
#include
main(int argc, char **argv)
{
int significant_digits = 6;
double value;
char buffer[80]; /* Buffer for gcvt */
if(argc < 2)
{
printf("Usage: %s \n", argv[0]);
}
else
{ /* Convert the number to internal */
value = atof(argv[1]); /* form. Then call gcvt. */
gcvt(value, significant_digits, buffer);
printf("Buffer from gcvt contains: %s\n", buffer);
}
}

  3 Responses to “Category : C Source Code
Archive   : CBIBLE.ZIP
Filename : GCVT.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/