Question about (double *)NULL
- From: rouben@xxxxxxxxxxxxxxxxxx (Rouben Rostamian)
- Date: Sun, 30 Apr 2006 12:26:33 +0000 (UTC)
Umfpack is a C library for computations dealing with sparse
matrices. Several examples in the User's Guide use a certain
cast that puzzles me. Here is an example.
The prototype of the function umfpack_di_symbolic() is:
int umfpack_di_symbolic
(
int n_row,
int n_col,
const int Ap [ ],
const int Ai [ ],
const double Ax [ ],
void **Symbolic,
const double Control [UMFPACK_CONTROL],
double Info [UMFPACK_INFO]
);
The header file umfpack.h has:
#define UMFPACK_CONTROL 20
Here is a sample usage:
int main (void)
{
double *null = (double *) NULL ;
...
(void) umfpack_di_symbolic (n, n, Ap, Ai, Ax, &Symbolic, null, null) ;
...
return (0) ;
}
(Code fragments are put here by "cut-and-paste"ing from the manual.)
My question is: Does the cast in (double *)NULL accomplish anything?
It seems to me that the call to umfpack_di_symbolic() equivalent to:
umfpack_di_symbolic (n, n, Ap, Ai, Ax, &Symbolic, NULL, NULL) ;
Comments?
--
Rouben Rostamian
.
- Follow-Ups:
- Re: Question about (double *)NULL
- From: A. Bolmarcich
- Re: Question about (double *)NULL
- From: Michael Mair
- Re: Question about (double *)NULL
- From: jacob navia
- Re: Question about (double *)NULL
- Prev by Date: Re: Casting void * to void ** ?
- Next by Date: Re: Generic Stack problem
- Previous by thread: First program in C - what is going on with function returns?
- Next by thread: Re: Question about (double *)NULL
- Index(es):
Relevant Pages
|