Try this
[DllImport( "kernel32.dll")]
private static extern void FillMemory( byte[] arr, int size, byte fill );
Usage -
byte [] myArray = new byte[10];
FillMemory( myArray, myArray.Length, 0xFF );
--
Shak
(Houston)
"Alan Chen" <li**********@hotmail.com> wrote in message
news:4c**************************@posting.google.c om...
Hi,
I have a byte array which I'd like to init to all 0xFF. The array size
is passed in as a parameter. What is the best way to do it?
I can certainly do it in a loop but it is not effecient.
Thanks in advance for your input!