Why isn't the size of an array parameter the same as within main?

后端 未结 13 2126
[愿得一人]
[愿得一人] 2020-11-21 04:13

Why isn\'t the size of an array sent as a parameter the same as within main?

#include 

void PrintSize(int p_someArray[10]);

int main () {
           


        
13条回答
  •  清歌不尽
    2020-11-21 05:15

    In the C language, there is no method to determine the size of an unknown array, so the quantity needs to be passed as well as a pointer to the first element.

提交回复
热议问题