Category : C Source Code
Archive   : CSRC2.ZIP
Filename : SPRINT.C

 
Output of file : SPRINT.C contained in archive : CSRC2.ZIP
/*
* s p r i n t . c
*
* Formatted numeric conversion
*/

/*)LIBRARY
*/

#ifdef DOCUMENTATION

title sprintf Formatted Numeric Conversion
index Formatted Conversion

synopsis
.s.nf
char *
sprintf(buffer, format, arg1, ...);
char *buffer;
char *format;
.s.f
Description

sprintf() converts and formats its arguments, writing the
result to the indicated string buffer.

For information on formatting, please refer to the description
of printf.

sprintf() returns a pointer to the EOS byte at the end
of the output buffer. Note, however, that this feature
is not transportable to other C implementations.

Bugs

#endif

#include

char *
sprint(buffer, format, args)
char *buffer;
char *format;
/*
* Formatted conversion
*/
{
FILE dummyiov;
register FILE *fd;

fd = &dummyiov;
fd->_flag = _IOSTRG | _IOWRT;
fd->_base = NULL;
fd->_ptr = buffer;
fd->_cnt = 32767;
c_doprnt(format, &args, fd);
return (fd->_ptr);
}


  3 Responses to “Category : C Source Code
Archive   : CSRC2.ZIP
Filename : SPRINT.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/