Click here to Skip to main content
16,008,954 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 21:03
Mustafa Ismail Mustafa11-Dec-08 21:03 
GeneralRe: Ignoring \n in a binary file during reading Pin
Stuart Dootson11-Dec-08 21:11
professionalStuart Dootson11-Dec-08 21:11 
GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 21:44
Mustafa Ismail Mustafa11-Dec-08 21:44 
GeneralRe: Ignoring \n in a binary file during reading Pin
Stuart Dootson11-Dec-08 23:11
professionalStuart Dootson11-Dec-08 23:11 
GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa12-Dec-08 1:00
Mustafa Ismail Mustafa12-Dec-08 1:00 
GeneralRe: Ignoring \n in a binary file during reading Pin
Luc Pattyn11-Dec-08 3:07
sitebuilderLuc Pattyn11-Dec-08 3:07 
GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 3:18
Mustafa Ismail Mustafa11-Dec-08 3:18 
GeneralRe: Ignoring \n in a binary file during reading Pin
Luc Pattyn11-Dec-08 3:40
sitebuilderLuc Pattyn11-Dec-08 3:40 
when the data is binary, there are no delimiters by default; however you should not use anything that is string-oriented since string methods will react on special characters such as NULL and sometimes NEWLINE.

AFAIK writing a char array to the console in C++ is considered a string operation, so it will stop at the first NULL, interpret every NEWLINE, TAB, etc.
Not sure what sizeof is supposed to do on a char*.
getline for sure is a string operation, not applicable to binary data.
etc. etc.

One advice: fix your reading code until you are completely satisfied, and add error detection code;
do this before you start using your data since now you are building on quicksand and that will keep you doubting everything and hence slow you down.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Fixturized forever. Confused | :confused:


GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 3:48
Mustafa Ismail Mustafa11-Dec-08 3:48 
GeneralRe: Ignoring \n in a binary file during reading Pin
Luc Pattyn11-Dec-08 4:32
sitebuilderLuc Pattyn11-Dec-08 4:32 
GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 4:45
Mustafa Ismail Mustafa11-Dec-08 4:45 
AnswerRe: Ignoring \n in a binary file during reading Pin
VentsyV11-Dec-08 6:55
VentsyV11-Dec-08 6:55 
GeneralRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 10:36
Mustafa Ismail Mustafa11-Dec-08 10:36 
QuestionRe: Ignoring \n in a binary file during reading Pin
David Crow11-Dec-08 8:13
David Crow11-Dec-08 8:13 
AnswerRe: Ignoring \n in a binary file during reading Pin
Mustafa Ismail Mustafa11-Dec-08 10:39
Mustafa Ismail Mustafa11-Dec-08 10:39 
GeneralRe: Ignoring \n in a binary file during reading Pin
bulg11-Dec-08 12:13
bulg11-Dec-08 12:13 
Questionalgorithms of combination Pin
mayamay11-Dec-08 2:31
mayamay11-Dec-08 2:31 
AnswerRe: algorithms of combination Pin
Mustafa Ismail Mustafa11-Dec-08 2:34
Mustafa Ismail Mustafa11-Dec-08 2:34 
GeneralRe: algorithms of combination Pin
mayamay11-Dec-08 2:43
mayamay11-Dec-08 2:43 
GeneralRe: algorithms of combination Pin
Mustafa Ismail Mustafa11-Dec-08 2:55
Mustafa Ismail Mustafa11-Dec-08 2:55 
GeneralRe: algorithms of combination Pin
mayamay11-Dec-08 3:00
mayamay11-Dec-08 3:00 
GeneralRe: algorithms of combination Pin
Mustafa Ismail Mustafa11-Dec-08 3:05
Mustafa Ismail Mustafa11-Dec-08 3:05 
AnswerRe: algorithms of combination Pin
BonshatS11-Dec-08 3:37
BonshatS11-Dec-08 3:37 
QuestionMD5 - different results Pin
gabbana11-Dec-08 2:15
gabbana11-Dec-08 2:15 
AnswerRe: MD5 - different results Pin
Stuart Dootson11-Dec-08 2:32
professionalStuart Dootson11-Dec-08 2:32 

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.