OK....How do we do this

  • Thread starter Thread starter TGF
  • Start date Start date
T

TGF

Here is some C code....


unsigned char *bytePtr;

handle = open(filename, r);

bytePtr = new (unsigned char *)malloc(256);

if (handle!=-1) {
bytesRead = read(handle, buffer, 256);
if (bytesRead>0) {
// do stuff with bytePtr at the byte level
// i.e. bytePtr++, bytePtr += 30;
...
...
}
}

....What would be the most effecient way to do this using Managed C++? Now
remember, I have alot of code that needs access to the data read at the byte
level.

-TGF
 
FileStream* fs...;
Byte buf[4096];
int read = fs->Read(buf, 0, buf->Length);
char __pin* ptr = &buf[0];

Then you manipulate ptr like normal in C++
....
 
Back
Top