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
10 months agoHyun
10 months agoAlaine
11 months agoJosue
11 months agoLouis
11 months agoWillis
11 months agoLauran
12 months agoKate
12 months agoRosamond
12 months agoGilberto
12 months agoKing
12 months agoRoy
12 months agoChaya
12 months agoDevorah
1 year 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