Which of the Operators cannot be Overloaded in C language?

By Mandeep Kumar|Updated : August 1st, 2022

1. +

2. -

3. %

4. ::

Operator overloading refers to the ability of C++ language to dispense the operators with a special meaning for a data type.

Answer: Scope resolution operator (::) cannot be overloaded in C language.

Scope resolution operator (::) is used for getting hidden names due to variable scopes so that it can be used. It is an enclosing context where values and expressions are associated. It is used to identify and specify identifiers used in different scopes. In computer programming, the use of scope varies across different programming languages.

It is represented by a double colon and is also known as Paamayim Nekudotayim. It allows access to static, constant, and overridden properties or methods of a class. Besides, it allows access to public and protected members of a base from within the child class. It can be used for the various purpose like:

  • Defining a function outside a class.

  • In case of multiple Inheritance.

  • Accessing a global variable when there is a local variable with the same name.

  • Accessing a class’s static variables.

  • To access the hidden variables or member functions of a program.

Summary:

Which of the Operators cannot be Overloaded in C language?

The operator that cannot be overloaded in C language is the Scope resolution operator (::).

Read More:

Comments

write a comment

PO, Clerk, SO, Insurance

BankingIBPS POIBPS ClerkSBI POIBPS SOSBI ClerkRBIIDBI SORRBLICESICNainital BankOtherQuick LinkMock Test

Follow us for latest updates