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