
April 23rd, 2003, 12:38 AM
|
|
Junior Member
|
|
Join Date: Apr 2003
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Hi,
I rad your article, and I'm writing a bottom-up sorting function that takes a pointer to a function, in my sorting function I try call my pointer to a function and I'm supposed to pass two arguments to it. But I'm having trouble doing that, if someone could please give me a clue on how to do this, I would be most grateful.
The code:-
void mysort(type *base,int nel,int width,int (*compar)(type *,type *))
inside the mysort function I call the compar function which is of two types that I have written :-
1. int comparestr(const void *i, const void *j)
2. int intcompare(const void *i, const void *j)
what I need to pass to compar function is type aux[i] and type aux[j] , type is my struct.
Thanks in advance.
|