bwells Posted April 24, 2003 Posted April 24, 2003 I have an array of long integers and I want to save them to a binary file. I can do this in managed or unmanage c++. What is the easiest way to do this? thanks Bryan Quote
*Experts* Nerseus Posted April 24, 2003 *Experts* Posted April 24, 2003 If you can do it in either, I'd use managed C++. Or, are you asking *how* to do it in either managed or unmanaged? -Ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
bwells Posted April 25, 2003 Author Posted April 25, 2003 Yes, I was asking how to do it in Managed code. I have a way that I got to work, but I am not sure its the prefered way. I am using a FileStream and the BinaryWriter.Write method. But the binary writer write method does not take a unsigned long so I cast it to be _int32. Do you think this works? What would you recommend? I have an array of unsigned longs to write, but when I did an array write, it was writing bytes insead of longs. Is there a way to write an array of unsigned longs from Managed C++, or should I iterate over the array and write each element? thanks Bryan Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.