读写文件
来源:互联网 发布:小米4c数据信号不稳定 编辑:程序博客网 时间:2024/06/11 17:42
FILE *fp1,*fp2;
fp1 = fopen("D:\\1.txt", "r");
fp2 = fopen("D:\\2.txt", "w");
if ( NULL == fp2)
{
cout<<"NULL"<<endl;
return 0;
}
while (!feof(fp1))
{
char ch[100];
fputs(fgets(ch, 100, fp1), fp2);
}
fclose(fp1);
fclose(fp2);
fp1 = fopen("D:\\1.txt", "r");
fp2 = fopen("D:\\2.txt", "w");
if ( NULL == fp2)
{
cout<<"NULL"<<endl;
return 0;
}
while (!feof(fp1))
{
char ch[100];
fputs(fgets(ch, 100, fp1), fp2);
}
fclose(fp1);
fclose(fp2);
- 文件读写、剪贴板读写
- 读写文件
- 文件读写
- 读写文件
- 读写文件
- 文件读写
- 读写文件
- 读写文件
- 读写文件
- 文件读写
- 文件读写
- 文件读写
- 文件读写
- 读写文件
- 文件读写
- 文件读写
- 文件读写
- 文件读写
- 【POJ-3094】Quicksum
- DEV GridControl 常用属性(一)
- struts2中的标签 # % %{#}
- 关于差分约束系统
- Linux 内核--fork()函数创建进程 (续)之copy_mem(int nr, struct task_struct *p)
- 读写文件
- 创建型设计模式(2):简单工厂模式
- 2013年4月第二周周记
- java 并发编程
- 数据类型 ntext 和 varchar 在not equal to 运算符中不兼容
- static,inline,volatile的作用
- 你是个软件架构师吗?
- PL/SQL developer 使用oracle新建的数据库问题
- ADB server didn't ACK