⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 p2-1.c

📁 SUN Solaris8平台下进程间通信
💻 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 + -