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
4 months agoHyun
5 months agoAlaine
5 months agoJosue
5 months agoLouis
5 months agoWillis
6 months agoLauran
6 months agoKate
6 months agoRosamond
6 months agoGilberto
6 months agoKing
6 months agoRoy
6 months agoChaya
6 months agoDevorah
6 months agoLouvenia
12 months agoRolland
10 months agoAlonso
10 months agoAudria
11 months agoVirgina
12 months agoMelissa
12 months agoLucina
12 months agoMakeda
12 months agoEleonore
12 months agoCharlene
12 months agoAhmed
11 months agoAhmed
11 months agoAmira
1 year ago