Hacker News new | past | comments | ask | show | jobs | submit login

Where can I find more about this BASIC compatibility mode? Thnx





Of course it isn't really BASIC compatibility mode. In reality, it's an lesser-known array initialization syntax. It's explained here: https://jameshfisher.com/2016/12/25/c-array-literal-explicit...

In short, you can initialize an array like this, by specifying each element in order:

   int foo[] = {10,20,30}; // initialize elements 0, 1, and 2
However, you can also initialize specific array elements:

   int foo[] = {[50] 10, [51] 20, [52] 30}; // initialize elements 50, 51, 52
"BASIC compatibility" mode uses the above syntax.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: