I'm in a course of C++, I found this a little bit confusing.
We're studying structs, and, if we create a new object from that structure, we can access to its properties using for example foo.property
, but I found that to access to the struct statements, they use the ::
operator, and I only found a difference between .
and ::
in the object they are accessing, but reading a little more about ::
, I found that you can access to global context's variables or functions using ::property
, but that's what I don't get, that it means that doing class::property
is accessing to that property to the global context of the program, or is accessing to the global property inside the class, like doing obj.property
?
So, what are the differences between .
and ::
?
I come from JavaScript, so for my this is a little bit complex, and I didn't found a clear answer for this, and I don't found a clear response about what is ::
in general and its use.