Welcome: Hunan Intelligent Applications Tecgnology CO.,ltd.-HNIAT.com
Language: Chinese ∷  English

Basic knowledge

Difference between . and :: and : and -> in C++

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;

4.: Generally used to indicate inheritance;

CONTACT US

Contact: Manager Xu

Phone: 13907330718

Tel: 0731-22222718

Email: hniatcom@163.com

Add: Room 603, 6th Floor, Shifting Room, No. 2, Orbit Zhigu, No. 79 Liancheng Road, Shifeng District, Zhuzhou City, Hunan Province

Scan the qr codeClose
the qr code