Home All Groups Group Topic Archive Search About

initialize an array with a specific value (calloc?)

Author
22 Dec 2006 3:39 PM
Kevin
Hi

I am specifying a byte array of known size using
Dim data(100) As Byte

which creates an array with 0's.  I would like to create the array with
a specific value instead of zeros, if my memory serves me correctly
this is like calloc (or is it malloc?) in c.  What is the fastest way
to do this in vb .net?
Thanks
Kevin

Author
22 Dec 2006 4:10 PM
vbnetdev
Dim hashWithSaltBytes() As Byte = _
                                   New Byte(hashBytes.Length + _
                                            saltBytes.Length - 1) {}
Show quoteHide quote
"Kevin" <kevinherr***@lycos.co.uk> wrote in message
news:1166801989.622624.90170@h40g2000cwb.googlegroups.com...
> Hi
>
> I am specifying a byte array of known size using
> Dim data(100) As Byte
>
> which creates an array with 0's.  I would like to create the array with
> a specific value instead of zeros, if my memory serves me correctly
> this is like calloc (or is it malloc?) in c.  What is the fastest way
> to do this in vb .net?
> Thanks
> Kevin
>