lost_bits1110
asked on
want to declare an ifstream as part of my class
hello
whne I declare a member of type ifstream in my class, I get errors such as:
error: within this context
/usr/lib/gcc/i386-redhat-l inux/3.4.2 /../../../ ../include /c++/3.4.2 /streambuf : In member function `std::basic_filebuf<char, std::char_traits<char> >& std::basic_filebuf<char, std::char_traits<char> >::operator=(const std::basic_filebuf<char, std::char_traits<char> >&)':
/usr/lib/gcc/i386-redhat-l inux/3.4.2 /../../../ ../include /c++/3.4.2 /streambuf :776: error: `std::basic_streambuf<_Cha rT, _Traits>& std::basic_streambuf<_Char T, _Traits>::operator=(const std::basic_streambuf<_Char T, _Traits>&) [with _CharT = char, _Traits = std::char_traits<char>]' is private
and this happens if I just declare something of type ifstream as one of my public member variables , like so:
#include <iostream>
#include <fstream>
using namespace std;
class SOMECLASS
{
void blabla()
ifstream infile;
};
I'm on a linux, why doesnt it like this?????
Thank you in advance!!
LD
whne I declare a member of type ifstream in my class, I get errors such as:
error: within this context
/usr/lib/gcc/i386-redhat-l
/usr/lib/gcc/i386-redhat-l
and this happens if I just declare something of type ifstream as one of my public member variables , like so:
#include <iostream>
#include <fstream>
using namespace std;
class SOMECLASS
{
void blabla()
ifstream infile;
};
I'm on a linux, why doesnt it like this?????
Thank you in advance!!
LD
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can you echo the lib path
ASKER
*** glibc detected *** double free or corruption: