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

📄 1b.c

📁 liunx下的shell实现;进程、线程同步的实现;I/O系统调用的比较(mmap)——操作系统的课程设计
💻 C
字号:
#include <stdio.h>#include <stdlib.h>#include <string.h>#define N 1024struct buffer{char buff[N];struct buffer *next;};int main(void){void shuchu(struct buffer *q,int j);FILE *fpin;struct buffer *head=NULL,*p;int i=1,j;fpin=fopen("text","rb");if(fpin==NULL){printf("can't open this file\n");return 1;}while(i){p=(struct buffer*)malloc(sizeof(struct buffer));if(head==NULL){p->next=NULL;head=p;}else{p->next=head;head=p;}j=i;i=fread(p->buff,sizeof(char),N,fpin);}fclose(fpin);shuchu(head,j);} void shuchu(struct buffer *q,int j){FILE *fpout;int i,flag=0;char temp[N];fpout=fopen("text","wb");do{for(i=N-1;i>=0;i--){temp[N-i-1]=q->buff[i];}q=q->next;if(flag==0){fwrite(temp+1024-j,sizeof(char),j,fpout);flag=1;}else{fwrite(temp,sizeof(char),N,fpout);}}while(q!=NULL);fclose(fpout);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -