29 Novembre

This commit is contained in:
Adrian POURCHOT 2022-11-29 11:31:08 +01:00
parent aca1866b8e
commit 008ce05b82
4 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,26 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
int* n=malloc(4);
FILE* f;
f=fopen("nbrExec.txt","r");
if(f!=NULL){
fread(n,4,1,f);
fclose(f);
printf("Le code a ete executer %d fois.\n",*n);
f=fopen("nbrExec.txt","w");
*n=*n+1;
fwrite(n,4,1,f);
fclose(f);
} else {
*n=1;
printf("Le code a ete executer %d fois.\n",*n);
f=fopen("nbrExec.txt","w");
*n=*n+1;
fwrite(n,4,1,f);
fclose(f);
}
return 0;
}

View File

@ -0,0 +1,20 @@
#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;
}

View File

@ -0,0 +1,6 @@
fzdauvdu
21726781
21TZ561rfbn 2
S2
s&yuzt&y
dzada

Binary file not shown.