开发者

Strange brackets in code I am reading

开发者 https://www.devze.com 2023-02-11 09:21 出处:网络
What does it mean if I ha开发者_JS百科ve in the middle of c++ code, things in brackets likt: [..]

What does it mean if I ha开发者_JS百科ve in the middle of c++ code, things in brackets likt:

[..]

What do these brackets mean? is it cli?


This is probably in your code editor and the purpose is to allow you to see more "context" code. Thus if you close a block of code you see more of what follows underneath.


sorry in advance - not sure if this is too simple.

perhaps this is the subscript operator.

the primary use for this is to access a specific array element:

const int array[2] = {0,1};
const int value(array[0]); // access element 0 of `array`
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号