I have created a class called “ShortestTime”. I have some functions within it that are not member functions, but I would like them to be able to access my member variables.
ie. I have a function that sorts a List that is a public member variable, but it doesn’t have access to this member variable.
I have read something about “friend” but was unable to get this to work. How do I solve my problem?
Thanks for the help,
Robin
There are ways you could use friend to solve your problem but we would need to see sample code.
But my personal approach would be to add a function to ShortestTime that sorts your private member.
Is there a reason that won’t work?