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.
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: