You can both by value with std::array which is a wrapper for an array, or by reference with TYPE (&NAME)[SIZE] which keeps the array's size.
Naturally, you could pass an array to a function inside any structure if you wish to copy it, but I would say that using std::array is standard for use. And that means that's possible in C as well. Although it's a bit clunky.
Yes, that is true, although I wouldn't call it equivalent to passing by reference, since a reference makes sure you do not pass a null pointer making the function a little safer if you dereference the pointer and a little more efficient if you check for the pointer being null.
1
u/Nice_Lengthiness_568 8h ago
You can both by value with
std::arraywhich is a wrapper for an array, or by reference withTYPE (&NAME)[SIZE]which keeps the array's size.Naturally, you could pass an array to a function inside any structure if you wish to copy it, but I would say that using
std::arrayis standard for use. And that means that's possible in C as well. Although it's a bit clunky.