#include <stdio.h>
#include <malloc.h>
#include <memory.h>
int main()
{
FILE *fp = NULL, *fpNew = NULL;
long l = 0;
char* pstring = NULL, *pNewString = NULL;
if( (fp = fopen( "e:\\a.txt", "r" )) != NULL )
{
fseek(fp, 0, SEEK_END);
l = ftell(fp);
fseek(fp, 0, SEEK_SET);
pstring = (char*)malloc(l);
pNewString = (char*)malloc(l);
fread(pstring, sizeof( char ), l, fp );
printf( "%s\n", pstring );
}
else
{
printf( "Problem opening the file\n" );
return 0 ;
}
fpNew = fopen("e:\\b.txt", "w");
for(int i = 0; i < l; i++)
{
int j = 0;
if((64 < (int)pstring[i] && (int)pstring[i] < 90 )||
(95 < (int)pstring[i] && (int)pstring[i] <123))
{
pNewString[j] = pstring[i];
fwrite(pNewString, sizeof(char), 1, fpNew);
}
else if((int)pstring[i] == 32)
{
pNewString[j] = '\n';
fwrite(pNewString, sizeof(char), 1, fpNew);
}
}
free(pstring);
free(pNewString);
return 0;
}
File_R&W.rar_读 单词
版权申诉
40 浏览量
2022-09-21
03:11:51
上传
评论
收藏 7KB RAR 举报
刘良运
- 粉丝: 67
- 资源: 1万+
最新资源
- hasp驱动 win10可用,不死机不蓝屏
- 00000000044242851月光摇篮曲.m4a
- 基于JavaScript讲解的数据结构和算法
- python计算机视觉python-computer-vision.rar
- VB+ACCESS计算机等级考试管理系统(源代码+系统+答辩PPT).zip
- python密码python-ciphers.rar
- 2c60fbb3dt9ad50ed8864298eea1484b.MP4
- 基于yolov8+dlib实现视觉识别的安全驾驶监测系统部署到jetson NX平台源码+模型.zip
- Qt框架+OpenCV+动态爱心+编程教学+520
- 基于opencv+yolov8实现目标追踪及驻留时长统计源码.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈