M
mechanicfem
In f(), I am passing a parameter of array type - /size/ indicates the
array's length:
void f(char arr[], int size);
In the c99 stds, it mentions the use of [*] and says (I think) that it
can be used to indicate that an array parameter has /variable length/ -
so, f() may be rewitten as:
void f(char arr[*], int size);
So, I think my understanding of [*] is wrong, as I cannot see that this
adds anything. Unless it's maybe a commenting mnemonic of some type -
to inform the programmer that arr's length isn't fixed. However, in
that case, one wonders why the presence of /size/ doesn't do the trick?
Could someone please tell me what [*] is for then?
x
Jo
array's length:
void f(char arr[], int size);
In the c99 stds, it mentions the use of [*] and says (I think) that it
can be used to indicate that an array parameter has /variable length/ -
so, f() may be rewitten as:
void f(char arr[*], int size);
So, I think my understanding of [*] is wrong, as I cannot see that this
adds anything. Unless it's maybe a commenting mnemonic of some type -
to inform the programmer that arr's length isn't fixed. However, in
that case, one wonders why the presence of /size/ doesn't do the trick?
Could someone please tell me what [*] is for then?
x
Jo