cin.getline() func not found

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • newguy194
    New Member
    • May 2007
    • 25

    cin.getline() func not found

    I'm using the Dev-C++ compiler and currently whenever I compile a program which uses cin.getline() it returns this error:

    Code:
    64 E:\DevCplus\Dev-Cpp\yesm.cpp no matching function for call to `std::basic_istream<char, std::char_traits<char> >::getline(std::string&)'
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Originally posted by newguy194
    I'm using the Dev-C++ compiler and currently whenever I compile a program which uses cin.getline() it returns this error:

    Code:
    64 E:\DevCplus\Dev-Cpp\yesm.cpp no matching function for call to `std::basic_istream<char, std::char_traits<char> >::getline(std::string&)'
    Cane we see your line 64 and your declaration of the variables used on that line?

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      cin.getline() needs a char* argument and not a string&.

      Comment

      Working...