What happens when you attempt to compile and run the following code?
#include
#include
#include
#include
#include
#include
using namespace std;
class B { int val;
public:
B(int v=0):val(v){}
int getV() const {return val;}
operator int() const { return val; };};
template
ostream & out;
Out(ostream & o): out(o){}
void operator() (const T & val ) {out< int main () { int t[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; fstream f("test.out", ios::trunc|ios::out); list l(t, t+10); for_each(l.begin(), l.end(), Out(f)); f.close(); f.open("test.out"); for( ; f.good() ; ) { B i; f>>i; cout< } f.close(); return 0; }
Letha
8 months agoHyun
9 months agoAlaine
9 months agoJosue
9 months agoLouis
9 months agoWillis
10 months agoLauran
10 months agoKate
10 months agoRosamond
10 months agoGilberto
10 months agoKing
10 months agoRoy
10 months agoChaya
10 months agoDevorah
10 months agoLouvenia
1 year agoRolland
1 year agoAlonso
1 year agoAudria
1 year agoVirgina
1 year agoMelissa
1 year agoLucina
1 year agoMakeda
1 year agoEleonore
1 year agoCharlene
1 year agoAhmed
1 year agoAhmed
1 year agoAmira
1 year ago