Hello,
What you want is function pointers, for which you'll need to use a typedef if I
understand you right; try a google for function pointer and it will show you
how they work.
HTH,
Thanks,
Tyler Littlefield
http://tds-solutions.net
Twitter: sorressean
On Mar 15, 2010, at 8:29 PM, Jimmy Johnson wrote:
> I have an attribute `sort_function' which is to be assigned a function taking
> two arguments of pointers to GET_entry.
>
> The function will be used in a call to sort from within a descendant of class
> vector, as in:
>
> std::sort (begin(), end(), sort_function);
>
> I want a feature `set_sort_function' which takes the appropriate type
> argument for assignment to `sort_function'.
>
> Can't seem to get the syntax right. Any help would be appreciated.
>
> bool (*sort_function)(GET_entry *, GET_entry *);
>
> void set_sort_function (?? some-type-here ?? a_function) {
> sort_function = a_function;
> };
>
> best regards,
>
> Jimmy J. Johnson
>
>
------------------------------------
To unsubscribe, send a blank message to
<mailto:[email protected]>.Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/c-prog/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/c-prog/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/