simple.cvc 697 B

12345678910111213141516171819202122232425262728293031323334353637
  1. extern void printInt(int val);
  2. extern void printSpaces(int num);
  3. extern void printNewlines(int num);
  4. /*void foo(int a, int b, int c) {
  5. int d;
  6. printInt(a);
  7. printInt(b);
  8. printInt(c);
  9. printInt(d);
  10. }
  11. void bar() {
  12. foo(1, 2, 3);
  13. }*/
  14. void foo(int[a, b] p) {
  15. int l;
  16. int[2,3] q;
  17. l = a;
  18. printInt(l);
  19. printSpaces(1);
  20. l = b;
  21. printInt(l);
  22. printSpaces(1);
  23. //q = p; // should give an error
  24. // only possible without dimension reduction
  25. printInt(p[1, 0]); // 10
  26. printSpaces(1);
  27. printNewlines(1);
  28. }
  29. export int main() {
  30. int i = 1;
  31. int[4, i] arr;
  32. arr[1, 0] = 10;
  33. foo(arr);
  34. return 0;
  35. }