I know this can't work. You can only pass pointers in C and thus the sizeof() of it will always be the size of the pointer. sizeof() will only return the size of a whole array if it is an array (no lvalue) and the compiler knows the size at compile time.
Well, it happened to me to make a struct containing the array to do that as for me
You can have whole array pointers as well AFAIK. Although I don't use them. It has it's own shared of problems.
int main(int argc, char * argv[]) it is the same as this one, but with fixed size
arrays are lvalues, they aren't modifiable lvalues. anything that designates a potential object is an lvalue
Обсуждают сегодня