没有合适的资源?快使用搜索试试~ 我知道了~
自己编的---学习C语言文件的一些小程序
需积分: 3 5 下载量 79 浏览量
2011-10-11
15:09:48
上传
评论
收藏 5KB TXT 举报
温馨提示
试读
7页
自己编的 学习C语言文件的一些小程序 推荐初学者下载
资源推荐
资源详情
资源评论
#include<stdlib.h>
#include<stdio.h>
#define LEN 1000
int main()
{
FILE *psourcef,*pdestf;
char destfname[20],storage[LEN];
int i=0,cout=0;
if((psourcef=fopen("E:\\a.txt","rt"))==NULL)
{
printf("打开出错!\n");
//getch();
exit(1);
}
printf("请输入目标文件名\n");
scanf("%s",destfname);
if((pdestf=fopen(destfname,"wt"))==NULL)
{
printf("打开出错!\n");
//getch();
exit(1);
}
for(i;i<LEN-1&&(!feof(psourcef));i++)
{
storage[i]=fgetc(psourcef);
cout++;
}
//*fputs("原来的数据:\n",pdestf);
for(i=0;i<cout-1;i++)
#include<stdio.h>
#define LEN 1000
int main()
{
FILE *psourcef,*pdestf;
char destfname[20],storage[LEN];
int i=0,cout=0;
if((psourcef=fopen("E:\\a.txt","rt"))==NULL)
{
printf("打开出错!\n");
//getch();
exit(1);
}
printf("请输入目标文件名\n");
scanf("%s",destfname);
if((pdestf=fopen(destfname,"wt"))==NULL)
{
printf("打开出错!\n");
//getch();
exit(1);
}
for(i;i<LEN-1&&(!feof(psourcef));i++)
{
storage[i]=fgetc(psourcef);
cout++;
}
//*fputs("原来的数据:\n",pdestf);
for(i=0;i<cout-1;i++)
{
fputc(storage[i],pdestf);
}
//fputs("\n*****************************************************************\n转换后的数据:\n",pdestf);*/
/*for(i=cout-2;i>-1;i--)
{
fputc(storage[i],pdestf);
}*/
fclose(psourcef);
fclose(pdestf);
return 0;
}
----------------------------------------------------------------------
#include<stdlib.h>
#include<stdio.h>
#define LEN 1000
int main()
{
FILE *psourcef,*pdestf;
fputc(storage[i],pdestf);
}
//fputs("\n*****************************************************************\n转换后的数据:\n",pdestf);*/
/*for(i=cout-2;i>-1;i--)
{
fputc(storage[i],pdestf);
}*/
fclose(psourcef);
fclose(pdestf);
return 0;
}
----------------------------------------------------------------------
#include<stdlib.h>
#include<stdio.h>
#define LEN 1000
int main()
{
FILE *psourcef,*pdestf;
剩余6页未读,继续阅读
资源评论
sogerno1
- 粉丝: 3
- 资源: 18
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功