如果我这样写,我返回结果为1。不明白为什么?预期答案是 5。
int main()
{
const char* list_of_filename[] = {"One","Two","Three","Four","Five"};
printf("%d", countFiles(list_of_filename));
return 0;
}
int countFiles(const char* list_of_filename[])
{
return sizeof(list_of_filename) / sizeof(list_of_filename[0]);
}