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?
- All operators can be overloaded in C++.
- We can change the basic meaning of an operator in C++.
Discussion:
20 comments Page 1 of 2.
Ansari Arsalan Zakir said:
4 years ago
Please explain the answer clearly.
Will said:
4 years ago
Yes, we can change basic meaning by operator overloading.
(5)
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.
Hence option C is correct.
(1)
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.
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)
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.
Bharat said:
10 years ago
I think we can change the meaning of any operator. Can't we?
Sandip Shelke said:
1 decade ago
Some of the operator can not be overloaded such as ?, :, ::.
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.
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.
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.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers