Relating Strings & FileStream in C++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manwanirg
    New Member
    • Feb 2007
    • 3

    Relating Strings & FileStream in C++

    can the file contents be directly read into a C++ string object pointer instead of character pointer?
  • horace1
    Recognized Expert Top Contributor
    • Nov 2006
    • 1510

    #2
    Originally posted by manwanirg
    can the file contents be directly read into a C++ string object pointer instead of character pointer?
    you can use the >> operator (read up to next whitespace) or getline() function see
    http://www.msoe.edu/eecs/ce/courseinfo/stl/string.htm

    Comment

    Working...