Re: question about "call qsort"



Elena wrote:
I found "call qsort" in Compaq visual fortran version.
I need to use but i don't know how.
Is there anybody that can help me?
thanks.

qsort() is a standard C library routine.

     void
     qsort(void *base, size_t nmemb, size_t size,
             int (*compar)(const void *, const void *))


You are either calling that routine, or a routine to interface between Fortran and C.

In C, the arguments are:

1) A pointer to the array to sort.
2) The number of elements in the array.
3) The number of bytes, as defined by C, in each element.
4) A pointer to a function that will compare two elements, when given
   pointers to those two elements, and return a negative, zero, or
   positive value indicating that the first is less than, equal, or
   greater than the second.

Calling the C routine would require the second and third argument to
be called by value.  Otherwise, they likely follow the Fortran calling
convention.

Posting the statement making the call and declarations for the arguments would help.

-- glen


.



Relevant Pages