| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Calling a overloaded operator with a pointer to a object
I want to call the objects overloaded [] operator using a pointer to the object
example: FunClass myfun; FunClass *lotsofunptr=&myfun; myfun[string]; //calls the overloaded [] operator lotsofunptr->[string];///error help is much apreciated |
|
#2
|
|||
|
|||
|
Had exactly the same problem the other day. The syntax you're after is -
Code:
(*lotsofunptr)[string]; Hope that helps, -KM- |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Calling a overloaded operator with a pointer to a object |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|