freopen
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| 在头文件 <stdio.h> 中定义
|
||
现有的文件流
stream重新分配到不同的文件确定由filenameusing指定的模式。 mode使用,以确定新的文件访问模式. 原文:
Reassigns an existing file stream
stream to a different file identified by filenameusing specified mode. mode is used to determine the new file access mode. 目录 |
[编辑] 参数
| filename | - | 文件名称相关联的文件流
原文: file name to associate the file stream to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mode | - | null结尾的字符串,确定新的文件访问模式
原文: null-terminated character string determining new file access mode
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stream | - | 修改的文件流
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[编辑] 返回值
stream成功,NULL失败[编辑] 示例
stdout下面的代码重定向到一个文件中
原文:
The following code redirects
stdout to a file
输出:
stdout is printed to console
[编辑] 另请参阅
| 打开一个文件 (函数) | |
| 关闭一个文件 (函数) | |
| C++ documentation for freopen
| |