global getline vs istream::getline()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • constablebrew
    New Member
    • Jun 2010
    • 3

    global getline vs istream::getline()

    Why is the string version of getline() a global function while the char* version is part of the istream objects? I don't understand the reasoning behind this separation. Why isn't the string version simply an overloaded version of istream::getlin e()?

    This oddity has tripped me up several times, I tend to forget to use the global function and use the istream version.
Working...