In the process of learning C++, we often use . and :: and : and ->. Here we will sort out the differences between these commonly used symbols.
1. A.B then A is an object or a structure;
2. A->B means A is a pointer, -> is a member extraction, A->B is to extract a member B in A, and A can only be a pointer to a class, structure, or union;
3. :: is the scope operator, A::B represents the name B in the scope A, and A can be a namespace, class, or structure;