--- In [email protected], "izecksohn" <izecks...@...> wrote: > > --- "johnmatthews2000" <jm5678@> wrote: > > > > 2. Although most of the code looks ok, you don't use spaces within > > expressions > > > > if ((fscanf_returned < 1) && !feof(st->f)) > > What is the precedence between && and ! ?? > I need to look for it in the standard.
Add brackets if you want, but my main point was about the spaces - use (x + y) not (x+y). > > 9. You print out the user's average time before calling statistics_append, > > so the printed average doesn't include the last result. I don't know if > > this is deliberate, but it looks like a bug. > > It is a feature: It causes the user to compete against his previous > performance. Ok - so perhaps you could change the output to make this clearer. Instead of: You took 9 seconds to calculate it right. Your average was 8 seconds. which makes it sound like the 9 seconds is included in the average, how about: Your average was 8 seconds. This time you took 9 seconds to calculate it right. > > 10. In the fopen() statement you use mode "rb+"/"wb+". Although "the b is > > ignored on all POSIX conforming systems, including Linux" (Linux fopen > > man page), it implies you are opening a binary file. But the statistics > > file is a text file, so you shouldn't use 'b' here. > > I use a dual boot machine and I want to share the statistics file. So it > must be compatible between architectures. How does using 'b' help? Have you tried it without the 'b'? > P.S.: The wallpaper's glue's solvent is making me crazy. Don't drop any on your keyboard :-)
