The idiom (pass the array name and size as arguments) works by passing two numbers--the array address adn the number of elements. As you have seen, the function loses some knowledge about the original array; for example, it can't use sizeof to get the size and relies on you to pass the correct number of elements.
The Usual Array Function Idiom
最新推荐文章于 2022-06-11 14:21:08 发布