home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 1.ddi / CLIB1.ZIP / FPUTS.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  1.6 KB  |  46 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - fputs.c
  3.  *
  4.  * function(s)
  5.  *        fputs - puts a string on a stream
  6.  *-----------------------------------------------------------------------*/
  7.  
  8. /*[]------------------------------------------------------------[]*/
  9. /*|                                                              |*/
  10. /*|     Turbo C Run Time Library - Version 3.0                   |*/
  11. /*|                                                              |*/
  12. /*|                                                              |*/
  13. /*|     Copyright (c) 1987,1988,1990 by Borland International    |*/
  14. /*|     All Rights Reserved.                                     |*/
  15. /*|                                                              |*/
  16. /*[]------------------------------------------------------------[]*/
  17.  
  18.  
  19. #include <stdio.h>
  20. #include <_stdio.h>
  21. #include <string.h>
  22.  
  23. /*---------------------------------------------------------------------*
  24.  
  25. Name        fputs - puts a string on a stream
  26.  
  27. Usage        #include <stdio.h>
  28.         int fputs(const char *string, FILE *stream);
  29.  
  30. Prototype in    stdio.h
  31.  
  32. Description    copies the null-terminated string string to the named
  33.         output stream; it does not append a newline character.
  34.  
  35. Return value    success : the last character written
  36.                 else    : EOF
  37.  
  38. *---------------------------------------------------------------------*/
  39. int fputs (const register char *s, FILE *fp)
  40. {
  41.     register int len;
  42.  
  43.     len = strlen(s);
  44.     return  __fputn (s, len, fp)  ?  *(unsigned char *)(s+len-1) : EOF;
  45. }
  46.