From 3c7b2c22bcc565c027c33d6643bfa92fcbc274b4 Mon Sep 17 00:00:00 2001 From: ruanyf Date: Mon, 13 Sep 2021 20:41:47 +0800 Subject: [PATCH] docs(file): fixed #26 --- docs/file.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/file.md b/docs/file.md index 14de9b9..e01c158 100644 --- a/docs/file.md +++ b/docs/file.md @@ -197,7 +197,7 @@ freopen("output.txt", "w", stdout); printf("hello"); ``` -上面示例将文件`output.txt`关联到`stdout`,此后向`stdout`写入的内容,都会写入`foo.txt`。由于`printf()`默认就是输出到`stdout`,所以运行上面的代码以后,文件`output.txt`会被写入`hello`。 +上面示例将文件`output.txt`关联到`stdout`,此后向`stdout`写入的内容,都会写入`output.txt`。由于`printf()`默认就是输出到`stdout`,所以运行上面的代码以后,文件`output.txt`会被写入`hello`。 `freopen()`的返回值是它的第三个参数(文件指针)。如果打开失败(比如文件不存在),会返回空指针 NULL。