0

How to access a private function without using a public function inc++

22nd Jan 2019, 11:18 AM
Surath Singh
Surath Singh - avatar
3 odpowiedzi
+ 2
you can use "friend" keyword to allow certain functions to access tho. Or if its not your code and you really need to use a private variable, you can just remove the private identifier
22nd Jan 2019, 11:56 PM
Data
Data - avatar
+ 1
Private members can only be accessed from inside your class.
22nd Jan 2019, 1:27 PM
Zen
Zen - avatar
+ 1
If you want to use the function from outside, why privatize it in the first place? The point of a private function is to forbid this very thing!
22nd Jan 2019, 1:32 PM
HonFu
HonFu - avatar