types 903 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. struct A {
  2. int a;
  3. };
  4. int intFunction() {
  5. return 1;
  6. }
  7. bool boolFunction() {
  8. return true;
  9. }
  10. float floatFunction() {
  11. return 2.0;
  12. }
  13. int* intFunction(int* i) {
  14. return i;
  15. }
  16. bool* boolFunction(bool* b) {
  17. return b;
  18. }
  19. float* floatFunction(float* f) {
  20. return f;
  21. }
  22. A* structFunction(A* a) {
  23. return a;
  24. }
  25. void main() {
  26. int i = intFunction();
  27. print i;
  28. bool b = boolFunction();
  29. print b;
  30. float f = floatFunction();
  31. print f;
  32. print *intFunction(&i);
  33. print *boolFunction(&b);
  34. print *floatFunction(&f);
  35. print intFunction(&i)[0];
  36. print boolFunction(&b)[0];
  37. print floatFunction(&f)[0];
  38. A a;
  39. a.a = 53453;
  40. print structFunction(&a)->a;
  41. structFunction(&a)->a = 123443;
  42. structFunction(&a)[0].a += 3;
  43. (*structFunction(&a)).a += 1;
  44. (&a)->a += 4;
  45. (*(&a)).a += 5;
  46. print structFunction(&a)->a;
  47. }