initialize an array with a specific value (calloc?)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kevin

    #1

    initialize an array with a specific value (calloc?)

    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

  • vbnetdev

    #2
    Re: initialize an array with a specific value (calloc?)

    Dim hashWithSaltByt es() As Byte = _
    New Byte(hashBytes. Length + _
    saltBytes.Lengt h - 1) {}
    "Kevin" <kevinherring@l ycos.co.ukwrote in message
    news:1166801989 .622624.90170@h 40g2000cwb.goog legroups.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
    >

    Comment

    Working...