Hot answers tagged

4 votes
Accepted

I keep getting "expected EOF" when I use check50

When the code is run with the test data that check50 uses, 4111111111111113, it prints INVALID twice. check50 was expecting the program to end, not to print the second INVALID. The problem is obvious ...
Cliff B's user avatar
  • 68.4k
1 vote
Accepted

Receiving EOF when I execute check50 (Readability)

I found the mistake was in a space between %i\n and ", in the line printf("Grade %i\n ", (int) round(index)); The problem was solved when rewriting to: printf("Grade %i\n", (...
Martin Birkeland's user avatar
1 vote
Accepted

Can somebody please help me to better understand constant variables, and eof, and how they relate to pset3?

Constant variables, with const int MAX as an example, the const means that MAX will not be modified. It is constant so it must not, and will not be changed. Some reasons for using a const is; the ...
kluvin's user avatar
  • 1,223
1 vote

Pset 4 Recover Segmentation Fault

There's a few problems with your code, not sure which one is causing the segmentation fault. 1) Why are you using 2 as the third argument of fread? You're supposed to read 512 bytes at a time, not ...
Irene's user avatar
  • 1,687
1 vote
Accepted

EOF command not working

Are you sure that you are correctly interpreting what is happening? It sounds to me like the ctrl-d may well be working just fine, but the code is going into an infinite loop at some later point, but ...
Cliff B's user avatar
  • 68.4k
1 vote
Accepted

pset4 resize premature end of file encountered

I think maybe the relationship between biSize, biSizeImage, and bfSize is not reflected properly in the code. Here's reference from MSDN: bfSize: The size, in bytes, of the bitmap file. ~ MSDN ...
Sam Gerber's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible