float array to byte array

  • Thread starter Thread starter Cory Autry
  • Start date Start date
C

Cory Autry

What is the best way to convert a array of floats to a byte array, or at
least have the ADO dataset assignment operator see the array as a byte
array.

Thanks,
Jim
 
/*untestede code*/

int len=floatarray.Length;
byte[] bytes=new byte[len];
int x=0;
foreach(float f in floatarray)
{
byte[] t=BitConverter.GetBytes(f);
for(int y=0;y<4);y++)
bytes[y+x]=t[y];
x+=4;
}

That *should* compile.

Austin Ehlers
 
Back
Top