To tylko jedna z 2 stron tej notatki. Zaloguj się aby zobaczyć ten dokument.
Zobacz
całą notatkę
Passing t wo-dimensional arrays to functions • At least the number of colums should be defined in the parameter declaration • The number of rows is irrelevant • The function gets a pointer to an array of rows • Passing daytab to a function f : f(int daytab[2][13]) { ... } • or f(int daytab[][13]) { ... } • or f(int (*daytab)[13]) { ... } (a pointer to an array of 13 integers) f(int (*daytab)[13]) { ... } • daytab is a pointer to an array of 13 integers • Parentheses are necessary - brackets [] have higher precedence than * • Without parentheses: int *daytab[13] • would be an array of 13 pointers to integers • In case of multi-dimensional arrays: only the first dimension is free; others have to be specified
... zobacz całą notatkę
Komentarze użytkowników (0)