Can't use getline without overloading

Heya! I'm looking to use getline to read some input from a file but VS keeps telling me it can't do it and I'm looking at a similar program I typed in the past and can't figure out what's so different about it. there are 3 files.

menu.h
-----------------
#include "committee.h"
#include "listClass.cpp"

using namespace std;

#ifndef M_H
#define M_H
class Menu
{
public:
//Read in all committee information from a file and store
//all committee information into a sorted list.
Menu();

};
#endif





menuClass.cpp
-------------------

#include "menu.h"
#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>

using namespace std;

Menu::Menu()
{
int cIdin;
string cNamein, cPurposein;

ifstream fil;
fil.open("committees.txt");

if( fil.fail() )
cout << "File didn't open.";
else
while ( !fil.eof() )
getline(fil,cIdin);


}


and the main file..

main.cpp
--------------

#include "menu.h"
#include <iostream>
using namespace std;

int main()

{
Menu();
return 0;

}

Thanks a bunch!
You can't read integers like this:
1
2
3
int cIdin;

getline(fil,cIdin);

You need to use >>
 
fil >> cldin;

Last edited on
I'm an idiot! Thank you. :)
Topic archived. No new replies allowed.