string to stream

Discussion in 'C Programming' started by cersei, Aug 3, 2007.

  1. cersei

    cersei

    Joined:
    Aug 3, 2007
    Messages:
    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: Aug 3, 2007
    cersei, Aug 3, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rasmusson, Lars
    Replies:
    1
    Views:
    767
    popov
    Apr 30, 2004
  2. sherifffruitfly@gmail.com
    Replies:
    9
    Views:
    646
    Alex Buell
    Apr 27, 2006
  3. Alexander Korsunsky

    get stream mode flags from an opened stream

    Alexander Korsunsky, Feb 17, 2007, in forum: C++
    Replies:
    1
    Views:
    459
    John Harrison
    Feb 17, 2007
  4. dolphin
    Replies:
    6
    Views:
    562
    Thomas Fritsch
    Mar 18, 2007
  5. mrstephengross
    Replies:
    3
    Views:
    403
    James Kanze
    May 10, 2007
Loading...

Share This Page