Click here to Skip to main content
15,917,560 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: fputc or fgetc returning odd results [modified] Pin
Rajkumar R9-May-08 3:38
Rajkumar R9-May-08 3:38 
GeneralRe: fputc or fgetc returning odd results Pin
Klempie9-May-08 4:15
Klempie9-May-08 4:15 
OK. It looks as if it is reading EOF but the binary format of the file has 1A (26) as the last byte.

Firstly, the app is reading 255 which is the non-2s complement of -1 which is EOF. Why isn't it reading the 26 at all?

Second, what if there exists valid data equalling 255 that is not supposed to be the EOF? how do you tell the filestream to read it as such and keep the stream open?
GeneralRe: fputc or fgetc returning odd results Pin
Rajkumar R9-May-08 4:21
Rajkumar R9-May-08 4:21 
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 
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 

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.