| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
overloading
HOW to overload subscript operator to get the largest of elements in an array.
|
|
#2
|
|||
|
|||
|
As far my knowldege, you can not overload '[]' operator. Similarly the ternary operator can not be overloaded too.
|
|
#3
|
|||
|
|||
|
Quote:
You actually can overload [] http://www.cplusplus.com/doc/tutorial/tut4-2.html That website shows all of what you can overload. I think there are five operators that can't be overloaded: . .* :: ?: sizeof() |
|
#4
|
|||
|
|||
|
Kain, that's true, but I think what Cirus was getting at (or even if it wasn't what he meant) you can't overload any operator for data-types that aren't classes or structs.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > overloading |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|