Syntax when calling an array as the variable in a new block of code? [C] -
Syntax when calling an array as the variable in a new block of code? [C] -
i'm still pretty new coding i'm having problem syntax in situation. how supposed format this? whenever seek build program, says there error:
error: expected primary-expression before ']' token assign_q(chess[][]);
there's no need me set code here, here's little snippet:
#define n 8 int chess[n][n] = {2}, l, m; void assign_q(int chess[n][n]); int main() { int i, j; assign_q(chess[][]);
in c, if want pass array, have not have utilize []
-operator. []
-operator access array-elements.
in illustration chess
of type int [][]
, there no need de-reference it.
however, may not have pass array @ all. if declare array @ global scope have done it, can access straight anywhere within same compilation unit or 1 using extern
.
c arrays
Comments
Post a Comment