I have seen double colons (::
) in generated code. I was wondering what its purpose is?
:: is the scope resolution operator - used to qualify names.
In C++, scope resolution operator is ::. It is used for following purposes. 1) To access a global variable when there is a local variable with same name: // C++ program to show that we can access a global variable.
C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...
When passed as part of a `scanf` format string, “%*c” means “read and ignore a character”. There has to be a character there for the conversion to succeed, but other than that, the character is ignored. A typical use-case would be reading up to some delimiter, then ignoring the delimiter.
It's the namespace alias qualifier operator. Citing from the linked-to MSDN page:
The namespace alias qualifier (
::
) is used to look up identifiers. It is always positioned between two identifiers, as in this example:global::System.Console.WriteLine("Hello World");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With