const 665 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. const int* wusi(int i) {
  2. return &i;
  3. }
  4. const int wusi2(int i) {
  5. return i;
  6. }
  7. struct B {
  8. int b;
  9. };
  10. struct A {
  11. int a;
  12. B b;
  13. };
  14. void wusi(const A* a) {
  15. //a->a += 3;
  16. //a->b.b += 3;
  17. test(a->a);
  18. test(a->b.b);
  19. }
  20. void main() {
  21. const int i = 3;
  22. const int* w = &i;
  23. int a = i;
  24. a = i;
  25. const int* b = nullptr;
  26. const int** c = &b;
  27. const int* d = *c;
  28. b = wusi(3);
  29. a = wusi2(3);
  30. int* test = new int[5];
  31. delete test;
  32. //i += 3;
  33. int* e = nullptr;
  34. b = e;
  35. test(i + 1);
  36. test(e == d);
  37. test(e != d);
  38. A s;
  39. s.a = 3;
  40. s.b.b = 5;
  41. wusi(&s);
  42. }