0

suppose if I pass array by reference and then collect it in an array pointer , we can write int *arr or int arr[], what is the difference between two ?

M.M
  • 138,810
  • 21
  • 208
  • 365
  • Re-opening. That was not the right duplicate. The issue here is parameter adjustment, not argument decay. – juanchopanza Aug 01 '15 at 10:11
  • @juanchopanza how about [this one](http://stackoverflow.com/questions/22677415/why-do-c-and-c-compilers-allow-array-lengths-in-function-signatures-when-they/) ? – M.M Aug 01 '15 at 10:14
  • To answer the question: there is no difference, they are exactly the same. Nothing more needs to be said. Also, "pass array by pointer" would be a better description, "reference" means something else in C++. – M.M Aug 01 '15 at 10:15
  • What do you mean by "collect"? Can you add some example code, for the sake of being unambiguous? – Oliver Charlesworth Aug 01 '15 at 10:15
  • @MattMcNabb That was good but I think I found a better one, in that it asks essentially the same question as is asked here. – juanchopanza Aug 01 '15 at 10:18

0 Answers0