fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class test{
  5. public:
  6. struct obj{
  7. int _objval;
  8. };
  9. obj inclassobj;
  10. int _val;
  11. test(){}
  12. test(int x):_val(x){}
  13. test(int x, int y): _val(x), inclassobj{y}{}
  14.  
  15. };
  16.  
  17. int main() {
  18. test t(1,2);
  19. cout << t.inclassobj._objval;
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5380KB
stdin
Standard input is empty
stdout
2