3 ms·
Why can't arrays be passed as function arguments in C?
- schrodingersCat 12y agoThe type of array in C will determine how it is store din memory (see here for a good description: https://stackoverflow.com/questions/10696024/how-is-the-array-stored-in-memory https://stackoverflow.com/questions/10696024/how-is-the-arra...). Unlike a dynamic language like ruby or python, C statically addresses the elements of an array in memory. Pointers refer to the memory address of the array elements allowing you to use them as a variable, but not the whole array.