实验1.1
来源:互联网 发布:网络接口教程 编辑:程序博客网 时间:2024/06/02 09:01
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
char c;
int in,out;
in=open("file.in",O_RDONLY);
out=open("file.out",O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR);
if((in==-1) | (out==-1)) exit(1);
while(read(in,&c,1)==1)
write(out,&c,1);
close(in);
close(out);
exit(0);
}
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
char block[10];
int in,out;
int nread;
int num;
num=sizeof(block);
printf("%d",num);
in=open("file.in",O_RDONLY);
out=open("file2.out",O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR);
if((in==-1) | (out==-1)) exit(1);
while(nread=read(in,block,sizeof(block))>0)
write(out,block,nread);
close(in);
close(out);
exit(0);
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
int c;
FILE *in,*out;
int nread;
in=fopen("file.in","r");
out=fopen("filethree.out","w");
if((in==NULL) | (out==NULL)) exit(1);
while((c=fgetc(in)) != EOF)
fputc(c,out);
close(in);
close(out);
exit(0);
}
- 实验1.1
- 实验1.1
- 《数据结构》 实验1.1
- 《数据结构》 实验1.1
- C#实验十1.1
- 实验五1.1
- C++第二次实验1.1
- 实验
- 实验
- 实验
- 实验
- 实验
- 实验
- 实验
- 实验
- 实验
- 实验
- 实验。。
- 在Ubuntu 14.04 LTS系统中设置Apache虚拟主机
- 实习整理(十)
- cannot find implementation of method edt1 KeyDown
- java ftp工具类
- Android 蓝牙(概述)
- 实验1.1
- 对js中的引用类型的理解(5)——Date类型
- ios 中键盘自动隐藏
- cocos2d-x v3.9 关于RotateTo和SkewTo的疑问
- nginx 快速搭建
- Shell脚本:求命令行上所有的整数和
- Android Studio adb无法响应的解决方法
- 前端开发者都应知道的 jQuery 小技巧
- Cocos2dx-OpenGL ES2.0教程:纹理贴图(6)