Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Sending a strea...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 9549 of 9593
Post > Topic >>

Sending a stream of unsigned char's

by "Angus" <nospam@[EMAIL PROTECTED] > Apr 26, 2008 at 08:43 AM

Hello

I want to create streams of data that will include fundamental data types
but not classes or pointers.  Eg I might want create a stream with a
header(2 bytes), a length of message (2 bytes), and then use the basic
structure size,data where size is the number of bytes and data is the
binary
data.

An example piece of data could be a timestamp which is a double value.  So
size would be sizeof(double) followed by the data which would be the
double
value.

I can do all this at a low level but was wondering if I should really be
using the stream classes to do this?  If so can anyone give me any
pointers
as to how to get started.

As I have binary data is stringstream inappropriate?  If so which stream
class to use?

Angus




-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]




 2 Posts in Topic:
Sending a stream of unsigned char's
"Angus" <nos  2008-04-26 08:43:33 
Re: Sending a stream of unsigned char's
Christopher <cpisz@[EM  2008-05-05 12:35:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 14:43:39 CDT 2008.