typedef struct _DocumentRow
{
char * code /** The code */;
char * designation /** The designation */;
double quantity /** The quantity */;
char * unity /** The unity */;
double basePrice /** The base price */;
double sellingPrice /** The selling price */;
double discount /** The discount */;
double rateOfVAT /** The rate of VAT */;
struct _DocumentRow * next /** The pointer to the next row */;
} DocumentRow;
void DocumentRowList_init(DocumentRow ** list) {
DocumentRow *L;
list = ( DocumentRow ** ) malloc( sizeof( DocumentRow* ) );
if ( list == NULL ) {
fatalError( "memory is not enough" );
}
L = NULL;
list = &L;
}
After using the function DocumentRowList_init
, when I test if ( *list == NULL )
, it evaluates to false, why ? I have already set list = &L
and L = NULL
.