+ 1
Why does this work when I used ( int c[ ] ) in function parameters?
https://code.sololearn.com/cMdYnCmPorsQ/?ref=app Here I passed getarr(2,a) as arguments, and in function parameters I used void getarr(int n,int c[ ] ) instead of (int* c[ ] ). Why does this work? Isn't passing a in getarr(2,a) the pointer to the address of the first element? If that were the case isn't it supposed to be (int* c[ ] ). Someone please explain, I'm confused.
1 Answer
0
ćļ¼Øļ¼”ļ¼°ļ¼°ļ¼¹ ļ¼“ļ¼Æ ļ¼Øļ¼„ļ¼¬ļ¼°ć ohh thanks, i get it now.
I always get confused with pointers and arrays.
Gotta keep this in mind I guess,
a=&a;
*a=a[ ]