R
Roman Zeilinger
Hi
I have a beginner question concerning fscanf.
First I had a text file which just contained some
hex numbers:
0C100012
0C100012
....
It was easy to read this values into an integer variable:
FILE *fp = fopen("test.dat","r");
int mem_word = 0;
while (fscanf(fp,"%x", &mem_word) != EOF)
....
Now, I have the following format where my hex number
is splitted by spaces. So I wonder if there is
an easy way to parse such a line and not doing
a lot of space removing etc.
0C 10 00 12 // 00000000
0C 10 00 12 // 00000000
....
Thanks for helpful comments.
I have a beginner question concerning fscanf.
First I had a text file which just contained some
hex numbers:
0C100012
0C100012
....
It was easy to read this values into an integer variable:
FILE *fp = fopen("test.dat","r");
int mem_word = 0;
while (fscanf(fp,"%x", &mem_word) != EOF)
....
Now, I have the following format where my hex number
is splitted by spaces. So I wonder if there is
an easy way to parse such a line and not doing
a lot of space removing etc.
0C 10 00 12 // 00000000
0C 10 00 12 // 00000000
....
Thanks for helpful comments.