3 ms·
I don't think it's the same. arr[n] and [arr]n works because brackets simply expand to * (arr + n) in the first case, * (n + arr) in the second. C++ dictates i
by caraffle 8y ago
I don't think it's the same. arr[n] and [arr]n works because brackets simply expand to * (arr + n) in the first case, * (n + arr) in the second.
C++ dictates if a statement can be interpreted as a declaration, it will be (see "The most vexing parse"). Universal initialization was introduced to provide another way to ensure this doesn't happen.
https://softwareengineering.stackexchange.com/questions/133688/is-c11-uniform-initialization-a-replacement-for-the-old-style-syntax?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa https://softwareengineering.stackexchange.com/questions/1336...