>>37
short* f() {
printf("side effect\n");
return 0;
}
int main(void)
{
char * s = "";
printf("%zu\n", ARRAY_LENGTH(s));
printf("%zu\n", ARRAY_LENGTH(&s));
printf("%zu\n", ARRAY_LENGTH(f)); // WTF is this shit?
printf("%zu\n", ARRAY_LENGTH(*f)); // WTF?
printf("%zu\n", ARRAY_LENGTH(**f)); // WTF??
printf("%zu\n", ARRAY_LENGTH(***f)); // WTF???
printf("%zu\n", ARRAY_LENGTH(&f)); // WTF?
// printf("%zu\n", ARRAY_LENGTH(&&f)); // WTF is 'label f not defined'?
printf("%zu\n", ARRAY_LENGTH(f())); // where is my side effect?
// printf("%zu\n", ARRAY_LENGTH(&f())); // WTF, why can't I do this then?
int * x = 0;
printf("%zu\n", ARRAY_LENGTH(x++)); // Can you guess what happens?
return 0;
}
None of the above should compile. None of the above compiles in C++. If we are trying to help those who are "retarded enough not to remember the cardinality of the array", as
>>21 aptly put it, the usual arguments about manliness and having enough rope are even more irrelevant than usual.
Therefore I must conclude that your statement,
also, c does it better
Is grossly inaccurate.