comp.lang.ada
 help / color / mirror / Atom feed
* converting floats, ints byte arrays
@ 2001-07-12  5:46 Vladimir Bednikov
  2001-07-12  6:45 ` tmoran
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vladimir Bednikov @ 2001-07-12  5:46 UTC (permalink / raw)


Hi all,

I have a bunch of values I want to send via tcp, instead of converting
each to a string and sending it out, I want to store all the values into
a byte array, ie:
type byte is mod 256;
type byte_array is array(integer range <>) of byte;

The values are for example,

sampleRate : C.C_Float;
scalingFactor : C.C_Float;
numSamples : C.Unsigned;
numSensors : C.Unsigned;
positionChanged : C.Unsigned_Char;
groupBySensors : C.Unsigned_Char;

What I want is an array where the first C.C_Float'size bytes is the sample
rate,
the next C.C_Float'size bytes is the scaling factor, the next
C.Unsigned'size bytes
is the number of samples etc and finally send the byte array out via tcp.

Does anybody out there know of a way to do this.

All help is appreciated,
Thanks in advance





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-07-13 11:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-12  5:46 converting floats, ints byte arrays Vladimir Bednikov
2001-07-12  6:45 ` tmoran
2001-07-12 16:35 ` Jeffrey Carter
2001-07-13 11:34 ` David C. Hoos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox