0
Pass array to function in c++
When we want to pass the array to a funtion using this syntax : void myFunction(int param[ ]) { . . . } Why does it pass the pointer not the array itself , cause we haven't use * before the array? Also can we pass the array to the function by value?
5 Respuestas
+ 1
~ swim ~
Thanks for your explanation
When we pass by reference ,is it reliable for the string?
+ 1
~ swim ~
Thanks alot for your explanation
0
~ swim ~
So it's just by the design of the memory that the array pass by pointer?
Why it just pass the first element of the array by a pointer , what about the rest of the array?
0
~ swim ~
In dimensional array when we want to pass the using this syntax:
void myFunction(int param[]) { . . . }
It points to the first element of the first array ,so how it points the elements of the next array?
0
~ swim ~
When we pass the size , is it ok it dynamic array too?
( i mean the complier doesn't know the number of elements till the run time)