gets c++中的用法详解

来源:百度知道 编辑:UC知道 时间:2024/07/08 19:59:03
谢谢
不好意思
有没有中文的啊???

Get a line from the stdin stream. These functions are deprecated because more secure versions are available; see gets_s, _getws_s.

char *gets(
char *buffer
);
wchar_t *_getws(
wchar_t *buffer
);
template <size_t size>
char *gets(
char (&buffer)[size]
); // C++ only
template <size_t size>
wchar_t *_getws(
wchar_t (&buffer)[size]
); // C++ only

Parameters
buffer
Storage location for input string.

Return Value
Returns its argument if successful. A NULL pointer indicates an error or end-of-file condition. Use ferror or feof to determine which one has occurred. If buffer is NULL, these functions invoke an invalid parameter handler, as described in Parameter Validation. If execution is allowed to continue, these functions return NULL and set errno to EINVAL.

Remarks
The gets function reads a line from the standard input stream stdin