types 587 B

1234567891011121314151617181920212223242526272829303132333435
  1. struct A {
  2. int a;
  3. };
  4. void main() {
  5. int* a = new int[4];
  6. float* b = new float[4];
  7. bool* c = new bool[4];
  8. A* d = new A[4];
  9. int** e = new int*[4];
  10. float** f = new float*[4];
  11. bool** g = new bool*[4];
  12. A** h = new A*[4];
  13. a[2] = 243;
  14. b[2] = 23.5;
  15. c[2] = true;
  16. d[2].a = 64560;
  17. e[2] = &a[2];
  18. f[2] = &b[2];
  19. g[2] = &c[2];
  20. h[2] = &d[2];
  21. h[2]->a += 2;
  22. (*h[2]).a += 2;
  23. test(a[2]);
  24. test(b[2]);
  25. test(c[2]);
  26. test(d[2].a);
  27. test(*e[2]);
  28. test(*f[2]);
  29. test(*g[2]);
  30. test((*h[2]).a);
  31. }