istream >> simple question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aleksandr Dubinskiy

    istream >> simple question

    I am curious if there is good way to read in strings one word (an
    alphanumeric sequence of characters) at a time from a file using the >>
    operator. I don't want to read one character at a time or use scanf.

    Alex


  • John Harrison

    #2
    Re: istream >> simple question


    "Aleksandr Dubinskiy" <dubinskiy.1@os u.edu> wrote in message
    news:bf6dv9$4j2 $1@news.cis.ohi o-state.edu...[color=blue]
    > I am curious if there is good way to read in strings one word (an
    > alphanumeric sequence of characters) at a time from a file using the >>
    > operator. I don't want to read one character at a time or use scanf.
    >
    > Alex
    >[/color]

    Simple answer

    string word;
    file >> word;

    john


    Comment

    Working...