sakuragi h
2007-05-31 08:10:59 UTC
void function(int **array)
{
*array = malloc(100*sizeof(int)); //He said that we should assert that array != NULL
}
main()
{
int *ptr;
function (&ptr);
}
Please, anybody can explain? And by the way, is the example equivalent to something like this...? The second example doesn't give me a syntax error.
int *ptr;
ptr = NULL;
ptr = malloc(100*sizeof(int));
Is there a difference between the two?
}