|
-
September 30th, 2008, 10:05 AM
#1
Stupid Byte[] question
Folks,
is there a way to pass a Byte[] to a function starting at a specific offset. For exmaple:
Code:
// c code
void func(unsigned char *arrayPtr) {
}
unsigned char test[100];
func(&test[50]);
So I want to pass a byte array but at an offset (in this case 50).
Thanks.
-
September 30th, 2008, 10:16 AM
#2
Re: Stupid Byte[] question
No, there's not. At least, not using verifyable (not 'unsafe') .NET code - which is what you should be aiming for.
The way the framework usually does this is to pass an offset & length into any method which accepts a byte [] array.
e.g.
Code:
void MyMethod(byte [] bytes, int offset, int count)
{
}
Darwen.
-
September 30th, 2008, 10:28 AM
#3
Re: Stupid Byte[] question
Thanks, that's how I've implemented the code at the moment (offset & size params). I just wanted to make sure I wasn't missing an easy Byte function that provided the functionality I required.
Thanks again!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|