like 8 bytes at a time.
Read in 8 bytes perform some math then output to file.
How would I treat this?
I know I can do it with a DWORD but what would the other be?
like 8 bytes at a time.
Read in 8 bytes perform some math then output to file.
How would I treat this?
I know I can do it with a DWORD but what would the other be?
An array?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
You've asked a very broad question and in lots of ways, everybody's answer is valid.
What are you doing and what do you think makes sense?
If you want to work with more than four bytes at once, you simply need to work with more than four bytes at once. Does that mean per iteration? Perhaps some inner loop works with a single char, but it iterates more than four times... eight times... with the char variable changing sometimes. Or does that mean that you have to store more than eight bits? In that case, use a bigger type than a single char, or invent a new type.
Last edited by whiteflags; 01-03-2012 at 08:50 PM.
Trying to read in eight bytes as if it were a long long int and check to see if it is divisable by two and if so then do some math on it and output it to a file.
If it's binary you can pretty much store it any way that makes sense to you. You have to be smart enough to fiddle with bits if there is no native type you want to use.
The double data type is usually eight bytes.
Originally Posted by The Jargon File
Let's just hope that the bytes are intended to be a floating point number then...
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"
code blocks with GNU GCC compiler