Re: question about "call qsort"
- From: glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Sat, 28 May 2005 04:59:52 -0700
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
.
- References:
- question about "call qsort"
- From: Elena
- question about "call qsort"
- Prev by Date: question about "call qsort"
- Next by Date: Re: question about efficiency of fortran in parallel environments
- Previous by thread: question about "call qsort"
- Next by thread: Re: question about "call qsort"
- Index(es):
Relevant Pages
|
|