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

后端 未结 13 2483
[愿得一人]
[愿得一人] 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

    It's a pointer, that's why it's a common implementation to pass the size of the array as a second parameter to the function

提交回复
热议问题