4 ms·
Where can I find more about this BASIC compatibility mode? Thnx
by betimsl 2y ago
Where can I find more about this BASIC compatibility mode? Thnx
- hackyhacky 2y agoOf 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-indexes/ 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.
- betimsl 2y agoI never knew you can do this. Wow.