0

I think I have never seen a [] that doesn't mean array in C.

Background:
I was reading about l-values and r-values here: http://msdn.microsoft.com/en-us/library/bkbs2cds.aspx and there it says so. I am curious.

1 Answer 1

2

What it says there is "A subscript ([ ]) expression that does not evaluate to an array." The key words here are "evaluate to."

If you have an array of int called x, the expression x[5] evaluates to an int, not an array. On the other hand, if it's an array of arrays of int, the expression x[5] evaluates to an array of int, and therefore is can't be a valid l-value.

3
  • +1. Since you are here, what is an incomplete type? Commented Aug 29, 2013 at 16:28
  • @AnubhavSaini: A quick Google search turns up msdn.microsoft.com/en-us/library/200xfxh6.aspx which explains it better than I could. Commented Aug 29, 2013 at 16:30
  • not being lazy. Suspected the structure though. Thanks. Commented Aug 29, 2013 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.