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

  1. /*-----------------------------------------------------------------------*
  2.  * filename - puts.c
  3.  *
  4.  * function(s)
  5.  *        puts - 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. #include <stdio.h>
  19. #include <string.h>
  20. #include <_stdio.h>
  21.  
  22. /*---------------------------------------------------------------------*
  23.  
  24. Name            puts - outputs a string to stdout
  25.  
  26. Usage           int puts(const char *string);
  27.  
  28. Prototype in    stdio.h
  29.  
  30. Description     puts copies the null-terminated string string to the
  31.                 standard output stream stdout and appends a newline character.
  32.  
  33. Return value    On successful completion, puts returns the
  34.                 last character written. Otherwise, a value of EOF is
  35.                 returned.
  36.  
  37. *---------------------------------------------------------------------*/
  38. int puts( const register char *s )
  39.   {
  40.   int len = strlen( s );
  41.  
  42.   if( __fputn( s, len, stdout) != len )  return( EOF );
  43.  
  44.   return( ((fputc ('\n', stdout) != '\n')  ? EOF : '\n') );
  45.   }
  46.