DEV/DEV1.1/TP13:Fichiers/Fichiers:suite/hexadecimal.c

20 lines
320 B
C
Raw Normal View History

2022-11-29 11:31:08 +01:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
char* c=malloc(16);
FILE* f;
int i;
f=fopen("hexdump.txt","r");
if(f!=NULL){
fgets(c,16,f);
while(feof(f)==0){
for (i=0;i<16;i+=2){
printf("%x%x ",c[i+1],c[i]);
} printf("\n");
fgets(c,16,f);
} fclose(f);
}
return 0;
}