Access Operators in C ++

I am aware of C ++, I found this a bit confusing.

We study structures, and if we create a new object from this structure, we can access its properties using, for example, foo.property , but I found that they use :: to access the structure operators, and I found a difference between . and :: in the object they are accessing, but by reading a little more about :: , I found that you can access global context variables or functions using ::property , but this is what I am not getting, means that execution class::property access to this property in the global context of the program or access to the global property inside the class, for example do obj.property ?

So what are the differences between . and :: ?

I come from JavaScript, so for me it is a little more complicated, and I did not find a clear answer for this, and I did not find a clear answer about what :: in general and its use are.

+4
source share

Source: https://habr.com/ru/post/1495318/


All Articles