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