answersLogoWhite

0

Because certain operators, such as new and sizeof must provide predictable results. Overloading them would achieve nothing except to introduce unpredictability, thus overloading is not permitted.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What is the operator that cannot be overloaded?

There are 5 operators which cannot be overloaded. They are: * .* - class member access operator * :: - scope resolution operator * . - dot operator * ?:: - conditional operator * Sizeof() - operator Note:- This is possible only in C++.


Why ternary operator is not overloaded?

The ternary operator (known as the conditional operator in C++) cannot be overloaded because it is impossible to pass a test operand and two expression operands (either or both of which may be comma-separated) to a function. You can only pass values or references as arguments to a function. Even if it were possible, built-in functions and operators that rely on the conditional operator would likely break. Like all the other operators that cannot be overloaded (sizeof, typeid, ::, . and .*) the results must always be predictable because built-in operators and functions rely on them so heavily.


What are special operators in c plus plus?

The only "special" operators in C++ are those that cannot be overloaded. That is; the dot member operator (.), pointer to member operator (.*), ternary conditional operator (:?), scope resolution operator (::), sizeof() and typeof().


Which c plus plus operators cannot be overloaded?

1. Member-of operator (.) 2. Pointer-to-member-of operator (.*) 3. Ternary condition operator (?:) 4. Scope resolution operator (::) 5. sizeof operator 6. typeid operator


What are the disadvantages of scope resolution operator?

it cannot be operator overloaded.


Which operator cannot be overloaded c plus plus?

comma (,) is an example


Which operator not overloaded in c plus plus?

The if statementex.if (index < 5)printf("Index is less than 5\n");elseprintf("index is greater or equal to 5\n");(You can also replace the "if" with a "?" and the "else" with a "?" -- no, that would be syntax error)


Can static member function be overloaded?

Yes. Any function can be overloaded. However you cannot override a static member function. Only instance members can be overridden.


How can you can create a new operator through operator overloading?

You cannot create any new operators in C++. You can only overload the existing ones (although some, such as sizeof, new and delete cannot be overloaded). The only way to create a new operator is to implement it as a standard function with a named identifier. For instance, sqrt() is the standard library function that provides the square root operator, for which no real operator exists.


How do the IO facilities in C plus plus differ from those in C?

The C standard library IO facilities are not extensible. For instance, the printf() and scanf() functions cannot handle user-defined types. However, the C++ standard library provides IO streams with insertion and extraction operators (&lt;&lt; and &gt;&gt;) that can be overloaded to support any user-defined type.


What is the answer to 5k 7 3k?

5k 7 3k is a string of terms: it is not an equation (or inequality) and so cannot have an answer. It is not even an expression since there are no operators between the three terms.5k 7 3k is a string of terms: it is not an equation (or inequality) and so cannot have an answer. It is not even an expression since there are no operators between the three terms.5k 7 3k is a string of terms: it is not an equation (or inequality) and so cannot have an answer. It is not even an expression since there are no operators between the three terms.5k 7 3k is a string of terms: it is not an equation (or inequality) and so cannot have an answer. It is not even an expression since there are no operators between the three terms.


What does the job of c operators consist of?

A C operator is not a job or profession but rather a coding language. C operators perform certain tasks in programming such as a "+ " operator performs addition.