C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 37)
37.
Which of the following is correct about the statements given below?
  1. All operators can be overloaded in C++.
  2. We can change the basic meaning of an operator in C++.
Only I is true.
Both I and II are false.
Only II is true.
Both I and II are true.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
20 comments Page 1 of 2.

Prashant said:   8 years ago
Wrong answer.

there are some operator we can not overload like :: scope resolution
condition operator => ? :
dot operator=> .
pointer to member selectionoperator= > " -> "
sizeof() operartor
typeid operator

And all cast operator.
(3)

Yogesh soni said:   1 decade ago
1)we can not overload membership operator(.),turnery operator(: ?),scope resolution operator(::)and sizeof operator.

2)We can't change the basic meaning of an operator which to be overloaded.

Rajashekhar P I said:   1 decade ago
We can change meaning of an operator like ++ can be overloaded to decrement contents of matrix by 1. This is not preferred way of doing things, but its nothing like we cannot do it.

PARVESH said:   1 decade ago
1)All the operators can not be overloaded such as(::,.,# etc.)
and also

2)Basic meaning is not changeable of any operator.

3)But same operator can exhibit different behavior.

Andrei said:   1 decade ago
The basic meaning remains the same. We can only add functionality, if after we decide to use the operator in the normal way it was intended by C++, it will work just fine.

Shivam thaman said:   1 decade ago
Only existing operators can be overloaded & we cannot change the meaning of an existing operator. These are the core rules of operator overloading thing.

Naren said:   10 years ago
We can't change the meaning of operator but C++ has facility of giving special meaning to operator without changing its existing meaning.

Harsh Vardhan Verma said:   1 decade ago
We can not change the behavior of the operator example the operators / * + - , follow the BODMAS rules with their default priorities.

Pravin said:   6 years ago
We can change the meaning of an operator in operator overloading. But we can't change its function.

Hence option C is correct.
(1)

Chandu said:   1 decade ago
Some operators like sizeof, . , :?, ::, * are cannot be overloaded and we cannot change the basic functionality of an operator.


Post your comments here:

Your comments will be displayed after verification.