Follow

Guess 

@aras I assume it must be -9. The bracket and comma initialisers just cancel down, p is pointing to the 2nd element, 1[p] is same as p[1] (ie. Now the 3rd element in arr) because magic, operator precedence puts the negate after the resolve, so x of the 3rd is 9, which is then negated?

Guess correction 

@aras arg, looked it up, comma takes left side so -7

Guess correction 

@mdiluz the thinking is correct, the answer nope :)

Guess correction 

@aras oh. Oh no.
If *both* sets of commas cancel, and comma takes right side (got it right first time...) , then arr is actually (3,6,9),(12,15,18)... etc. Meaning we should have -21?

Guess correction 

@aras or, well, not both "cancelling", the second set should aggregate? Don't know how to describe that, but C let's you initialize struct members in an array sequentially, so I'm sticking with -21

Guess correction 

@aras I couldn't take the insanity and wrote it out. Looks right. Oh man. What a hellscape this language is.

Sign in to participate in the conversation
Gamedev Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!