#include<stdio.h>
#include<stdlib.h>
#define BUFF_SIZE 128
int main(int argc, char *argv[]){
//接收一个文件
FILE * fp = fopen(argv[1],"r");
char buffer[BUFFER_SIZE];
int n;
//生成一段十六进制字符
while( n = fread(buffer,1,128,fp) )
for(int i = 0; i< n;i++)
printf("%02x",buffer[i]);
fclose(fp);
return 0;
}