Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Why can't we have an array of references e.g. int a, b, c; int arr[3] = {a, b, c};? Commented Jan 7, 2016 at 13:10
  • 11
    Aha, found out why. Commented Jan 8, 2016 at 13:51
  • 2
    Could someone explain why void foo(int & x[100]); is parsed as "array of references" please? Is it because the "from-right-to-left" rule? If yes, it seems to be not consistent with how void foo(int (&x)[100]); is parsed as "a reference to a array". Thanks in advance. Commented Feb 11, 2017 at 0:52
  • 7
    It's not right to left, it's inside out, and [] binds tighter than &. Commented May 6, 2017 at 3:10
  • 2
    "This only accepts arrays of 100 integers. You can safely use sizeof on x" is a good clarification to mention. Commented Sep 22, 2022 at 8:04