std::gets
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <cstdio>
|
||
| char *gets( char *str ); |
(过时了) | |
读取stdin给定的字符串,直到找到一个换行符或文件结束时,.
Original:
Reads stdin into given character string until a newline character is found or end-of-file occurs.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目录 |
[编辑] 参数
| str | - | 字符串被写入
Original: character string to be written The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[编辑] 返回值
str成功,NULL其他方式Original:
str on success, NULL otherwiseThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 注释
不执行边界检查,因此这个功能是非常容易受到缓冲区溢出攻击。使用
fgets()了吧Original:
The bounds checking is not performed, therefore this function is extremely vulnerable to buffer-overflow attacks. Use
fgets() instead.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 另请参阅
| stdin,文件流或缓冲区的读取格式的输入 Original: reads formatted input from stdin, a file stream or a buffer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数) | |
| 得到一个字符串从一个文件流 Original: gets a character string from a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数) | |
| 将一个字符串写入一个文件流 Original: writes a character string to a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数) | |
| C documentation for gets
| |