Cipherous
October 22nd, 2004, 03:14 PM
great board btw,
I am working with some old com files which require data stored in byte arrays and I need to do this
I have the following:
int memoryAddress; //this is where the starting data is stored, its a file
int sizeOfFile;//size in terms of bytes
I need to assign a byte pointer to wherever address the file is
so I want to do this
byte* myData = whateverIsAtMemoryLocation (memoryAddress);
after that, I want to convert that file to a byte array so that I can store it else where
byte[] newData = new byte [sizeOfFile];
for (int i=0;i<sizeOfFile;++i)
newData[i]=(byte)(myData+i);
can anybody please help? when you go myData++, does it go to the next byte in memory? or does it do something else?
my gratitude in advance.
I am working with some old com files which require data stored in byte arrays and I need to do this
I have the following:
int memoryAddress; //this is where the starting data is stored, its a file
int sizeOfFile;//size in terms of bytes
I need to assign a byte pointer to wherever address the file is
so I want to do this
byte* myData = whateverIsAtMemoryLocation (memoryAddress);
after that, I want to convert that file to a byte array so that I can store it else where
byte[] newData = new byte [sizeOfFile];
for (int i=0;i<sizeOfFile;++i)
newData[i]=(byte)(myData+i);
can anybody please help? when you go myData++, does it go to the next byte in memory? or does it do something else?
my gratitude in advance.