Click here to Skip to main content
16,007,760 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Strange private boolean member behaviour inside a public function (long question) Pin
Joan M9-Mar-07 7:00
professionalJoan M9-Mar-07 7:00 
Questionfread switching endianness on unformatted binary file Pin
regzim8-Mar-07 9:42
regzim8-Mar-07 9:42 
QuestionRe: fread switching endianness on unformatted binary file Pin
David Crow8-Mar-07 9:52
David Crow8-Mar-07 9:52 
AnswerRe: fread switching endianness on unformatted binary file Pin
Chris Losinger8-Mar-07 11:10
professionalChris Losinger8-Mar-07 11:10 
GeneralRe: fread switching endianness on unformatted binary file Pin
regzim8-Mar-07 19:01
regzim8-Mar-07 19:01 
GeneralRe: fread switching endianness on unformatted binary file Pin
cp98768-Mar-07 19:27
cp98768-Mar-07 19:27 
GeneralRe: fread switching endianness on unformatted binary file Pin
Chris Losinger9-Mar-07 1:14
professionalChris Losinger9-Mar-07 1:14 
GeneralRe: fread switching endianness on unformatted binary file Pin
regzim9-Mar-07 8:16
regzim9-Mar-07 8:16 
I think I get now that this isn't an endianness issue at all.

>>why would an integer value ever have 'extra' data in it? >>if you only want that one byte, then just read that one >>byte.

well, for example:
00 00 00 06
is simply decimal "6", and the leading zeros are moot. But
f0 09 43 f7
| |
------------
|
(really a 4-byte long int)

(in my context) is a four byte/32 bit unsigned long int that makes for a very large nuber, and every byte is important to the resulting long int value, unlike the previous example's leading zeros. Until I "getc" the data in the file, I don't know what I'm going to get at all but I do know it's going to be four bytes that together represent a long int at any given time. I hope I'm putting this right...

>> if you need all four bytes, you have to correct for byte order and accept all four bytes. right?

Right. And I think I can finally ask a much more succint question than the rambling diatribe I had before:

I need to accept all four bytes at once. How do I correct for byte order?!

P.S. Keep in mind that I'm C++ self taught and there may be some gaps in my knowledge of the fundamentals, so don't assume I already know the most obvious, simple answers...

regzim
GeneralRe: fread switching endianness on unformatted binary file Pin
Chris Losinger9-Mar-07 8:29
professionalChris Losinger9-Mar-07 8:29 
GeneralRe: fread switching endianness on unformatted binary file Pin
regzim9-Mar-07 9:21
regzim9-Mar-07 9:21 
GeneralRe: fread switching endianness on unformatted binary file Pin
regzim9-Mar-07 9:24
regzim9-Mar-07 9:24 
GeneralRe: fread switching endianness on unformatted binary file Pin
Chris Losinger9-Mar-07 9:33
professionalChris Losinger9-Mar-07 9:33 
QuestionComparing Values Pin
Herboren8-Mar-07 8:00
Herboren8-Mar-07 8:00 
AnswerRe: Comparing Values Pin
Maximilien8-Mar-07 8:03
Maximilien8-Mar-07 8:03 
QuestionRe: Comparing Values Pin
David Crow8-Mar-07 9:43
David Crow8-Mar-07 9:43 
AnswerRe: Comparing Values Pin
Herboren8-Mar-07 10:38
Herboren8-Mar-07 10:38 
QuestionRe: Comparing Values Pin
David Crow8-Mar-07 10:58
David Crow8-Mar-07 10:58 
AnswerRe: Comparing Values Pin
Herboren8-Mar-07 11:11
Herboren8-Mar-07 11:11 
GeneralRe: Comparing Values Pin
David Crow8-Mar-07 16:51
David Crow8-Mar-07 16:51 
GeneralRe: Comparing Values Pin
cedance8-Mar-07 18:10
cedance8-Mar-07 18:10 
GeneralRe: Comparing Values Pin
Herboren10-Mar-07 22:41
Herboren10-Mar-07 22:41 
AnswerRe: Comparing Values Pin
Stephen Hewitt8-Mar-07 12:15
Stephen Hewitt8-Mar-07 12:15 
GeneralRe: Comparing Values [modified] Pin
Herboren10-Mar-07 21:48
Herboren10-Mar-07 21:48 
GeneralRe: Comparing Values Pin
Stephen Hewitt11-Mar-07 13:49
Stephen Hewitt11-Mar-07 13:49 
QuestionJumping Window ? Pin
CrocodileBuck8-Mar-07 5:35
CrocodileBuck8-Mar-07 5:35 

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.