求个c语言程序的代码 要求包含文件操作 80行代码 希望大家帮帮忙
以下是文件写入再读出#include#include#includeFILE *fp;void Write(FILE *fw);void Read(FILE *fr);int main(){ if ((fp = fopen(“file.txt”, “w”)) == NULL) { printf(“open failed!”); exit(0); } Write(fp); fclose(fp); if ((fp = fopen(“file.txt”, “r”)) == NULL) { printf(“read failed!”); exit(0); } Read(fp); fclose(fp);}void Write(FILE * fw){ char str[81]; printf(“Enter char with the end
![阿里云云效83行代码](http://www.jintuiyun.com/wp-content/uploads/2023/08/lazy-209.png)
求个c语言程序的代码 要求包含文件操作 80行代码 希望大家帮帮忙
以下是文件写入再读出#include#include#includeFILE *fp;void Write(FILE *fw);void Read(FILE *fr);int main(){ if ((fp = fopen(“file.txt”, “w”)) == NULL) { printf(“open failed!”); exit(0); } Write(fp); fclose(fp); if ((fp = fopen(“file.txt”, “r”)) == NULL) { printf(“read failed!”); exit(0); } Read(fp); fclose(fp);}void Write(FILE * fw){ char str[81]; printf(“Enter char with the end
发布者:luotuoemo,转转请注明出处:https://www.jintuiyun.com/10123.html