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