Introduction to commonly used special symbols in C + + (&, *,:,::,)

Source: Internet
Author: User

1, "&" generally means: with, reference, take address.

2, "*" There are basically 3 kinds of semantics:

  • Used to define pointers, such as: int *p;
  • Used to get the target pointed to by the pointer, such as: *p=10;
  • The basic operator (multiplied mathematically).

3, ":" Reference: http://blog.csdn.net/zimingjushi/article/details/6549390/

3, "::" Class scope operator. "::" indicates the class to which the member function belongs. For example: M::f (s) means that f (s) is a member function of class M.


4, "--" and "." The functionality of the implementation is the same as accessing a member variable or member function of a class, "." For normal variable operations, "--" can only be used for pointer variable operations. For example: If A is a pointer to an object, A->f (s) represents the member function f (s) in the object referred to by a.

Introduction to commonly used special symbols in C + + (&, *,:,::,)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.