fork download
  1. #include <iostream>
  2.  
  3. class CLASS_ {
  4. public :
  5. CLASS_() : data { 5, 6 } {}
  6. CLASS_(int x, int y) : data { x, y } {}
  7. struct DATA{
  8. int x;
  9. int y;
  10. };
  11. DATA data;
  12. };
  13.  
  14. int main()
  15. {
  16. CLASS_ c1, c2(10, 20);
  17. std::cout << c1.data.x << "," << c1.data.y << std::endl
  18. << c2.data.x << "," << c2.data.y << std::endl;
  19. }
  20.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
5,6
10,20