We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From the Sudoku example:
foreach int[size] row : grid { foreach int cell : row { printf("%d ", cell); } printf("\n"); }
The text was updated successfully, but these errors were encountered:
After further investigation it turns out that the real problem is another one.
This works:
p print(int[SIZE][SIZE] _) { int[SIZE][SIZE] grid = { { 3, 0, 6, 5, 0, 8, 4, 0, 0 }, { 5, 2, 0, 0, 0, 0, 0, 0, 0 }, { 0, 8, 7, 0, 0, 0, 0, 3, 1 }, { 0, 0, 3, 0, 1, 0, 0, 8, 0 }, { 9, 0, 0, 8, 6, 3, 0, 0, 5 }, { 0, 5, 0, 0, 9, 0, 6, 0, 0 }, { 1, 3, 0, 0, 0, 0, 2, 5, 0 }, { 0, 0, 0, 0, 0, 0, 0, 7, 4 }, { 0, 0, 5, 2, 0, 6, 3, 0, 0 } }; foreach int[SIZE] row : grid { foreach int cell : row { printf("%d ", cell); } printf("\n"); } }
while this crashes the compiler:
p print(int[SIZE][SIZE] grid) { foreach int[SIZE] row : grid { foreach int cell : row { printf("%d ", cell); } printf("\n"); } }
So it seams that parameters behave differently than var declarations.
Sorry, something went wrong.
Fix #193
f0a9be8
The solution is now to not allow dynamically sized arrays as function/procedure parameters.
Fix #193 (#208)
b30cc33
* Rename arg to param * Fix #193
marcauberer
Successfully merging a pull request may close this issue.
From the Sudoku example:
The text was updated successfully, but these errors were encountered: