stl binary stream question

  • Thread starter frank.nielsen AT rocketmail DOT com
  • Start date
F

frank.nielsen AT rocketmail DOT com

Hi there

Properly a simple question for a stl programmer, which i'm not...

I am integrating two systems, one which is a c programs and the other uses stl. How do i pass a binary aray into a stream?! All examples i can find use file streams as input...

I fingue it will look something like this or maybe the stream has a .read method?!

void* data;
int datalen;

std::somekindofstream is( data, datalen );



Regards, Frank
 
J

John Harrison

"frank.nielsen AT rocketmail DOT com" <"frank.nielsen AT rocketmail DOT
com"> wrote in message news:[email protected]...
Hi there

Properly a simple question for a stl programmer, which i'm not...

I am integrating two systems, one which is a c programs and the other uses
stl. How do i pass a binary aray into a stream?! All examples i can find use
file streams as input...
I fingue it will look something like this or maybe the stream has a .read method?!

void* data;
int datalen;

std::somekindofstream is( data, datalen );



Regards, Frank

Not quite sure what you mean by a binary string, but probably what you are
looking for is a istrstream (not to be confused with a istringstream).

std::istrstream is((char*)data, datalen);

istrstream like all input streams has a read method.

john
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,167
Messages
2,570,913
Members
47,455
Latest member
Delilah Code

Latest Threads

Top