ARGH: getline wants 3 args when I give 2, and 2 args when I give 3?

This is a discussion on ARGH: getline wants 3 args when I give 2, and 2 args when I give 3? within the Windows Programming forums, part of the Platform Specific Boards category; I have this in a function: Code: CString path; ifstream fin; fin.open((LPCSTR)inputPath,ios::in); .... getline(fin,path,'\n'); but I get this message: error ...

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    72

    ARGH: getline wants 3 args when I give 2, and 2 args when I give 3?

    I have this in a function:

    Code:
      CString path;
      ifstream fin;
      fin.open((LPCSTR)inputPath,ios::in);
       ....
    	  getline(fin,path,'\n');
    but I get this message:
    error C2780: 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &)' : expects 2 arguments - 3 provided
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\string(525) : see declaration of 'std::getline'


    If I remove the third argument (the '\n'), I get this:
    error C2780: 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem)' : expects 3 arguments - 2 provided
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\string(473) : see declaration of 'std::getline'


    What the?
    Last edited by BrianK; 06-29-2004 at 05:41 PM.

  2. #2
    Registered User
    Join Date
    Oct 2002
    Posts
    72
    hmm... switched everything to strings instead of CStrings.

    working now. :P

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21