fork(11) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class toto
  6. {
  7. public:
  8. bool b;
  9. toto(bool x)
  10. {
  11. cout<< "constructor bool:" << (x ? "true": "false")<<endl;
  12. b = x;
  13. }
  14. ~toto() {}
  15. };
  16.  
  17. int main()
  18. {
  19. toto t = new toto(0);
  20. cout << "t.b is " << (t.b ? "true": "false")<<endl;
  21. t = new toto(false);
  22. cout << "t.b is " << (t.b ? "true": "false")<<endl;
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 4400KB
stdin
Standard input is empty
stdout
constructor bool:false
constructor bool:true
t.b is true
constructor bool:false
constructor bool:true
t.b is true