c - fscanf reading problem -
Sorry, maybe this is a stupid question.
I have a file:
36 146 10 53 240 133 104 28 51 81 124 ...
So I want to read numbers from a program , So I do:
... some functions .....
int i; Unsigned four key [16]; File * FP; Printf ("\ n ------ \ n"); // open filename fp = fopen ("key.txt", "a"); Printf ("Reading 128 bit key: \ n"); (Fscanf (fp, "% d \ t", and key [i]); Printf ("% d \ t", key to [i = 0; i & lt; 16; i ++] ];} Printf ("\ n ------ \ n"); fclose (FP); return 0;
But when the program prints the results on the screen Just meet me:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .....
Any ideas?
p = fopen ("key.txt")
It is also a good idea to see that fscanf () to be truly successful in reading To view the value.
Edit: I just saw:
Unsigned four keys [16];
There should be an array of inner (I think - what this "key" means) is not very clear from the code:
int key [16]; < / Code>
Comments
Post a Comment