想写个16进制编辑工具,可功力太差。今天偶尔闲了,练练手! /**//*********************************--------------Hex2Txt----------------------------------------By ayun*********************************//**//*------Hex2Txt.c------*/#include <stdio.h>int getfilesize(FILE *f)...{ int i; fseek(f,0,2); i=ftell(f); rewind(f); return i;}int main()...{ FILE *fp1,*fp2; int ch; if((fp1=fopen("Hex2Txt.exe","rb"))==NULL) ...{ printf("Can not open the file!"); getchar(); return 1; } getfilesize(fp1); if((fp2=fopen("Hex2Txt.txt","wb"))==NULL) ...{ printf("Can not open the file!"); getchar(); return 1; } ch=fgetc(fp1); while (ch!=EOF) ...{ fprintf(fp2,"%02X ",ch); ch=fgetc(fp1); } fclose(fp1); fclose(fp2); return 0;}