sorry, perhaps this is a stupid question.
I have a file like this:
36 146 10 53 240 133 104 28 51 81 124 ...
so I want to read the numbers from a program, so I do:
.... some function .....
int i;
unsigned char key[16];
FILE *fp;
printf ("\n ------ \n");
// open filename
fp = fopen("key.txt","a");
printf("reading 128 bit key:\n");
for (i = 0; i < 16; i++){
fscanf(fp,"%d \t", &key[i]);
printf ("%d \t", key[i]);
}
printf ("\n ------ \n");
fclose(fp);
return 0;
but when the program prints the results on screen I just get :
0 0 0 0 0 0 0 0 0 0 0 0 0 0 .....
any ideas ?