home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / diverses / jpl_c / getns.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-05-18  |  896 b   |  27 lines

  1. /* 1.2  01-08-86                        (getns.c)
  2.  ************************************************************************
  3.  *            Robert C. Tausworthe                *
  4.  *            Jet Propulsion Laboratory            *
  5.  *            Pasadena, CA 91009        1986        *
  6.  ************************************************************************/
  7.  
  8. #include "defs.h"
  9. #include "stdtyp.h"
  10. #include "stdio.h"
  11.  
  12. /************************************************************************/
  13.     STRING
  14. getns(p, s, n)        /* Prompt with message p on stdout, then get
  15.                string s of maximum n characters from stdin.
  16.                Return pointer to s.                */
  17. /*----------------------------------------------------------------------*/
  18. STRING p, s;
  19. {
  20.     char line[MAXLINE];
  21.  
  22.     fputs(p, stdout);
  23.     gets(line);
  24.     strncpy(s, line, n);
  25.     return s;
  26. }
  27.