#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
int main()
{
FILE *frp = NULL;
char *ibuff=NULL;
char *obuff=NULL;
frp = fopen("./manname.txt", "r");
fseek(frp, 0, SEEK_END);
unsigned long long malloc_size = ftell(frp);
printf("length is %ld\r\n", malloc_size);
fseek(frp, 0, SEEK_SET);
ibuff=(char*)malloc(malloc_size);
fread(ibuff,malloc_size,1,frp);
printf("%s\n", ibuff );
fclose(frp);
obuff=(char*)malloc(malloc_size);
char *itmp=ibuff;
char *otmp=obuff;
while(0!=*itmp)
{
if(isalpha(*itmp))
{
*otmp=*itmp;
itmp++;
otmp++;
}
else
{
itmp++;
}
}
printf("%s", obuff);
FILE *fwp;
fwp = fopen("./output_manname.txt", "w+");
fwrite(obuff, malloc_size, 1, fwp);
printf("%s\n", obuff);
fclose(fwp);
free(ibuff);
free(obuff);
return 0;
}