Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > string to stream

Thread Tools

string to stream

cersei cersei is offline
Junior Member
Join Date: Aug 2007
Posts: 1
Hi! Is there a way to convert a string to stream?

The reason I'm asking this is I'm working with a variable FILE *yyin. I have the line
yyin = fopen("program.txt","r");

But I'd like to pass a string instead of opening a file. I saw something like

yyin = new istringstream(stringinput);

but I can't make that work.

edit: i realized there is no way to make this work. it seems the yyin I saw is an istream afterall.

Last edited by cersei; 08-03-2007 at 03:43 PM..
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert DVD with subtitle stream to DivX with same subtitle stream(selectable) malise Software 1 04-17-2007 09:15 AM
what is the different between byte stream and character stream? dolphin Java 6 03-18-2007 01:58 PM
get stream mode flags from an opened stream Alexander Korsunsky C++ 1 02-17-2007 10:38 AM
How to GET multi-word input from a *file* stream as opposed to a *console* stream? C++ 9 04-27-2006 04:14 PM
Doing readline in a thread from a popen4('rsync ...') stream blocks when the stream ends. Rasmusson, Lars Python 1 04-30-2004 08:10 AM