|
-
March 6th, 2003, 07:02 PM
#1
STL: how to use a char array as an input stream
My application receives BINARY word-aligned data via character arrays. In other words, the sending application has a struct containing floats, ints, chars, etc. and what the application does is basically memcpy the struct into a char buffer and sends that buffer to my application.
My application recieves (a copy of) the buffer in a message, drops the buffer to a file, and then uses ifstream to open the file as a stream and reads data from it.
My question is can I cut out the "dropping the buffer to a file" part and read data directly from the allocated char buffer as if it was a stream? If so, how do I set up the char buffer as an input stream?
Thank you for your advice.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|