?
=?ISO-8859-1?Q?Martin_J=F8rgensen?=
Hi,
Today I got a really strange problem... I've made myself a data-file and
I read in data from that file....
When I read something like this line:
03 04 05, 00 04 01, 05 03 07, 08 03 00, 09 06 03 ... etc.
with something like scanf("%i %i %i, ", &var1, &var2, &var3);
then it stopped reading data starting with "08", "09" etc... But
everything such as "07" and below worked...
Then I tried scanf("%d %d %d, ", &var1, &var2, &var3);
And the program WORKED!?!!?
Why?
I looked in my C-book and it says absolutetly the same about using %i as
%d.... I'm too tired to cut down my progrm and post a small version of
it now, and it might be that's even unnecessary because somebody know
what's happening...
Compiler: Visual studio 2005, windows xp. I suspect perhaps it's a bug,
if my C book is right that there isn't any difference between %i and %d?
Best regards / Med venlig hilsen
Martin Jørgensen
Today I got a really strange problem... I've made myself a data-file and
I read in data from that file....
When I read something like this line:
03 04 05, 00 04 01, 05 03 07, 08 03 00, 09 06 03 ... etc.
with something like scanf("%i %i %i, ", &var1, &var2, &var3);
then it stopped reading data starting with "08", "09" etc... But
everything such as "07" and below worked...
Then I tried scanf("%d %d %d, ", &var1, &var2, &var3);
And the program WORKED!?!!?
Why?
I looked in my C-book and it says absolutetly the same about using %i as
%d.... I'm too tired to cut down my progrm and post a small version of
it now, and it might be that's even unnecessary because somebody know
what's happening...
Compiler: Visual studio 2005, windows xp. I suspect perhaps it's a bug,
if my C book is right that there isn't any difference between %i and %d?
Best regards / Med venlig hilsen
Martin Jørgensen