This is an old revision of the document!
<sxh c> #include <stdlib.h> #include <stdio.h>
class B {
public: B(int b) : m_b(b) {} operator int() { return m_b; }
int operator()() { return m_b*2; }
private: int m_b;
};
class A {
public: A(int i) { printf("Output is: %d\n", i); }
};
int main() {
int k = 6; A a( B(k) );
// what is the output of this program?
return 0;
}
</sxh>