Link to home
Start Free TrialLog in
Avatar of hasnpapa
hasnpapaFlag for Germany

asked on

How to declare my TList->sort function in (Class)header?

I'm using Borland C++ Builder and I've written my own sort function to sort a TList.

The code is:

int __fastcall my_sort_function(void *Item1, void *Item2){

      ... compare something
      return(result);
}

Im using it to do: MySortList->Sort(my_sort_function);

That works well!

The Question is:
How to declare
int __fastcall my_sort_function(void *Item1, void *Item2)
in the header file to make it a class member?

Reason: I'd like to give "my_sort_function" access to some class members.

This may be a stupid question? But I'm very new to C++ and learn the basic concepts now. Can anyone help me?


Thanks in advance!
ASKER CERTIFIED SOLUTION
Avatar of Zoppo
Zoppo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hasnpapa

ASKER

Thnks a lot - that helps me out! :-)
You're welcome ...

have a nice day,

best regards,

ZOPPO