📄 p2-1.c
字号:
#include <stdio.h>int main(void){ FILE *stream; char buf[80]; printf("open and creat test_file\n"); if ((stream = fopen("test_file","w")) == NULL ){ perror("open() failed"); exit(1); } printf("write string to test_file\n"); fputs("Hello world",stream); if ((stream = freopen("test_file","r",stream)) == NULL ){ perror("open() failed"); exit(1); } printf("read string from test_file\n"); fgets(buf, sizeof(buf), stream); printf("the string is \"%s\"\n", buf); fclose(stream);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -