Click here to Skip to main content
15,891,529 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: fputc or fgetc returning odd results Pin
Klempie9-May-08 4:28
Klempie9-May-08 4:28 
AnswerRe: fputc or fgetc returning odd results Pin
Klempie9-May-08 4:48
Klempie9-May-08 4:48 
GeneralRe: fputc or fgetc returning odd results Pin
Rajkumar R9-May-08 5:05
Rajkumar R9-May-08 5:05 
GeneralRe: fputc or fgetc returning odd results Pin
Rajkumar R9-May-08 4:56
Rajkumar R9-May-08 4:56 
AnswerRe: fputc or fgetc returning odd results Pin
Klempie9-May-08 5:06
Klempie9-May-08 5:06 
GeneralRe: fputc or fgetc returning odd results Pin
Rajkumar R9-May-08 5:10
Rajkumar R9-May-08 5:10 
AnswerRe: fputc or fgetc returning odd results Pin
toxcct9-May-08 3:06
toxcct9-May-08 3:06 
GeneralRe: fputc or fgetc returning odd results Pin
Klempie9-May-08 3:38
Klempie9-May-08 3:38 
toxcct, you may be onto something here.

I've done this:

for(unsigned int i = 1; i <= dict_size; i++)<br />
{<br />
    dictionary[i] = readintbigendian(in);<br />
    if(i%60==30) // test what flushing does<br />
        fflush(in);<br />
}


Interestingly, it now starts reading incorrectly from the 30th value onwards. So flushing is the cause of it rather than the solution. I'm no expert on the internals of stream mechanics, so any suggestions on how to restructure my stream access would be highly appreciated.
GeneralRe: fputc or fgetc returning odd results Pin
toxcct9-May-08 3:45
toxcct9-May-08 3:45 
GeneralRe: fputc or fgetc returning odd results Pin
Klempie9-May-08 3:47
Klempie9-May-08 3:47 
GeneralRe: fputc or fgetc returning odd results Pin
toxcct9-May-08 3:50
toxcct9-May-08 3:50 
GeneralRe: fputc or fgetc returning odd results Pin
Klempie9-May-08 3:53
Klempie9-May-08 3:53 
GeneralRe: fputc or fgetc returning odd results Pin
Rajkumar R9-May-08 4:27
Rajkumar R9-May-08 4:27 
GeneralRe: fputc or fgetc returning odd results Pin
CPallini9-May-08 5:01
mveCPallini9-May-08 5:01 
GeneralRe: fputc or fgetc returning odd results Pin
Klempie9-May-08 5:06
Klempie9-May-08 5:06 
QuestionMemory allocation help. Pin
chandu0049-May-08 1:06
chandu0049-May-08 1:06 
AnswerRe: Memory allocation help. Pin
toxcct9-May-08 1:11
toxcct9-May-08 1:11 
GeneralRe: Memory allocation help. Pin
Michael Schubert9-May-08 1:17
Michael Schubert9-May-08 1:17 
GeneralRe: Memory allocation help. Pin
chandu0049-May-08 1:24
chandu0049-May-08 1:24 
GeneralRe: Memory allocation help. Pin
JudyL_MD9-May-08 1:55
JudyL_MD9-May-08 1:55 
GeneralRe: Memory allocation help. Pin
chandu0049-May-08 2:12
chandu0049-May-08 2:12 
GeneralRe: Memory allocation help. Pin
JudyL_MD9-May-08 3:10
JudyL_MD9-May-08 3:10 
GeneralRe: Memory allocation help. Pin
Mark Salsbery9-May-08 6:16
Mark Salsbery9-May-08 6:16 
AnswerRe: Memory allocation help. Pin
king'ori9-May-08 3:49
king'ori9-May-08 3:49 
Questionhow to print SYSTEMTIME Pin
mihai1239-May-08 1:05
mihai1239-May-08 1:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.