mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-24 15:05:42 -05:00
vault backup: 2023-03-13 07:08:54
This commit is contained in:
parent
9761819456
commit
68328cdb76
13
content/notes/scope-resolution-operator.md
Normal file
13
content/notes/scope-resolution-operator.md
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
title: "scope-resolution-operator"
|
||||
tags:
|
||||
- cpp
|
||||
- cosc-342
|
||||
---
|
||||
|
||||
from chat gpt:
|
||||
The dot `.` operator is used to access the members of an object instance, which includes both non-static and static members. When you use the dot `.` operator, the left-hand side of the operator must be an instance of a class.
|
||||
|
||||
On the other hand, the scope resolution operator `::` is used to access the members of a class or namespace, which can be static or non-static. When you use the `::` operator, the left-hand side of the operator must be the name of a class or namespace.
|
||||
|
||||
If the member you are accessing is a static member, then you must use the scope resolution operator `::`. If the member is a non-static member, then you must use the dot `.` operator with an instance of the class.
|
||||
Loading…
Reference in New Issue
Block a user