#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
using namespace std;
int main(void){
unsigned char c[256][256];
memset(c,0,sizeof(c));
unsigned short a=0,b=0;
unsigned d=0;
unsigned char filename[]="";
printf("請輸入檔案路徑和檔案名:");
cin>>filename;//輸入完整路徑會出錯,只輸入檔案名則沒問題.
cout<<filename<<endl;
FILE *fp=fopen("c:/users/penghao/documents/a2.bin","rb");
fseek(fp,0,2);
d=ftell(fp);
fseek(fp,0,0);
fread(c,1,d,fp);
fclose(fp);
do{
b=0;
printf("%u",a);
printf(" : ");
do{
printf("%u",c[a][b]);
printf(" ");
b++;
}while(b<256);
printf("\n");
a++;
}while(a<256);
system("pause");
return 0;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/272984.html
標籤:新手樂園
上一篇:求大神解答一下
