Hi i'm trying to open a file and then pass it onto another class file. Below is the main.cpp, the error msg i am receiving is for the line: infile >> D;
error:
error: no match for 'operator>>' in 'infile >> D
If someone could please help me get rid of this error msg.
thanks
Code:
Main. cpp
#include <iostream>
#include <fstream>
#include <string>
#include "DaysData.h"
#include "VectorFile.h"
using namespace std;
int main()
{
ifstream infile;
ofstream outFile;
infile.open( "fileListAug.txt"); // Retrieves the file names for a the month from a particular txt.
if( !infile )
{
cout << "Cannot open input file"<< endl; // If file cannot open display an error message.
return -1;
}
DaysData D;
infile >> D; [B]//error line[/B]
return 0;
}
error: no match for 'operator>>' in 'infile >> D
If someone could please help me get rid of this error msg.
thanks
Comment