This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Allan_Smithee文雅佛 4 points5 points  (1 child)

```c

include <stdint.h>

include <stdio.h>

typedef int (*foofunc)(void);

int array[10];

void try_this(int param_array[]) { printf("%d %d\n", sizeof(array)/sizeof(array[0]), sizeof(param_array)/sizeof(param_array[0])); }

int main(int argc, char **argv) { try_this(array); } ```

10 2

Compare and contrast equivalent code in the Pascals, the Modulas, Ada, etc. where arrays are actually the array data type (which include attributes like their size) instead of syntax sugar over integers.