1
0

strexpected1 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #include <stdio.h>
  2. ('\0'). No check for buffer overrun is performed (see BUGS below).
  3. A terminating null byte ('\0') is stored after the last character in
  4. C89, C99, POSIX.1-2001. LSB deprecates gets(). POSIX.1-2008 marks
  5. Calls to the functions described here can be mixed with each other and
  6. EOF or a newline. If a newline is read, it is stored into the buffer.
  7. For nonlocking counterparts, see unlocked_stdio(3).
  8. It is not advisable to mix calls to input functions from the stdio
  9. Never use gets(). Because it is impossible to tell without knowing the
  10. This page is part of release 3.35 of the Linux man-pages project. A
  11. ated with the input stream; the results will be undefined and very
  12. available for subsequent read operations. Pushed-back characters will
  13. be found at http://man7.org/linux/man-pages/.
  14. be returned in reverse order; only one pushback is guaranteed.
  15. char *fgets(char *s, int size, FILE *stream);
  16. char *gets(char *s);
  17. char cast to an int or EOF on end of file or error.
  18. data in advance how many characters gets() will read, and because
  19. description of the project, and information about reporting bugs, can
  20. either a terminating newline or EOF, which it replaces with a null byte
  21. fgetc() reads the next character from stream and returns it as an
  22. fgetc(), getc() and getchar() return the character read as an unsigned
  23. fgetc, fgets, getc, getchar, gets, ungetc - input of characters and
  24. fgets() reads in at most one less than size characters from stream and
  25. fseek(3), getline(3), getwchar(3), puts(3), scanf(3), ungetwc(3),
  26. getc() is equivalent to fgetc() except that it may be implemented as a
  27. getchar() is equivalent to getc(stdin).
  28. gets() and fgets() return s on success, and NULL on error or when end
  29. gets() obsolescent.
  30. gets() reads a line from stdin into the buffer pointed to by s until
  31. gets() will continue to store characters past the end of the buffer, it
  32. input stream.
  33. int fgetc(FILE *stream);
  34. int getc(FILE *stream);
  35. int getchar(void);
  36. int ungetc(int c, FILE *stream);
  37. is extremely dangerous to use. It has been used to break computer
  38. library with low-level calls to read(2) for the file descriptor associ†macro which evaluates stream more than once.
  39. of file occurs while no characters have been read.
  40. probably not what you want.
  41. read(2), write(2), ferror(3), fgetwc(3), fgetws(3), fopen(3), fread(3),
  42. security. Use fgets() instead.
  43. stores them into the buffer pointed to by s. Reading stops after an
  44. strings
  45. the buffer.
  46. ungetc() pushes c back to stream, cast to unsigned char, where it is
  47. ungetc() returns c on success, or EOF on error.
  48. unlocked_stdio(3)
  49. unsigned char cast to an int, or EOF on end of file or error.
  50. with calls to other input functions from the stdio library for the same
  51. BUGS
  52. COLOPHON
  53. CONFORMING TO
  54. DESCRIPTION
  55. GETS(3) Linux Programmer's Manual GETS(3)
  56. GNU 2011-09-28 GETS(3)
  57. NAME
  58. RETURN VALUE
  59. SEE ALSO
  60. SYNOPSIS