string to stream

Joined
Aug 3, 2007
Messages
1
Reaction score
0
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:

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

No members online now.

Forum statistics

Threads
474,269
Messages
2,571,099
Members
48,773
Latest member
Kaybee

Latest Threads

Top