heyas,
i know this is a very big ask, but im recieving the following error and its driving me n_u_t_s. ill post both the error and the class that's causing it, any assistance or suggestions would be much appreciated. also if anyone can tell me how to identify and read these types of errors i'd be very thankful.
tia
-twans
Code:/usr/include/g++/bits/ios_base.h: In copy constructor `std::basic_ios<char, std::char_traits<char> >::basic_ios(const std::basic_ios<char, std::char_traits<char> >&)': /usr/include/g++/bits/ios_base.h:668: error: `std::ios_base::ios_base(const std::ios_base&)' is private PlayFileMAPRecord.cc:69: error: within this context /usr/include/g++/streambuf: In copy constructor `std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf(const std::basic_filebuf<char, std::char_traits<char> >&)': /usr/include/g++/streambuf:921: error: `std::basic_streambuf<_CharT, _Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char, _Traits = std::char_traits<char>]' is private PlayFileMAPRecord.cc:69: error: within this context ************************************************************************** class ************************************************************************** #include "PlayFileMAPRecord.h" #include<iostream> #include <fstream> using namespace std; PlayFileMAPRecord::PlayFileMAPRecord(void){ // default constructor } PlayFileMAPRecord::PlayFileMAPRecord(string pFileName){ sizeLines=0; char line[10000]; filename = pFileName; //open passed filename fileIn.open(pFileName.c_str()); while(!fileIn.eof()){ fileIn.getline(line,'\n'); //increments counter to get valid size value sizeLines++; } //close file -reading complete fileIn.close(); } int PlayFileMAPRecord::size(void) const { return sizeLines; } void PlayFileMAPRecord::print(void) const { cout << myLine; } ostream& PlayFileMAPRecord::operator<<(ostream& o) { this->print(); } PlayFileMAPRecord PlayFileMAPRecord::operator[](int index) const{ sizeLines=0; char line[10000]; //open passed filename fileIn2.open(filename.c_str()); while(!fileIn2.eof()){ fileIn2.getline(line,'\n'); sizeLines++; if(sizeLines==index) { myLine = line; //close file -reading complete fileIn2.close(); return *this; } } //close file -reading complete (nothing found) fileIn2.close(); }



LinkBack URL
About LinkBacks


