No, they are not always equivalent, but on most popular machines you'll be fine. calloc
writes a bit pattern of all-zeros to the allocated memory, but the null pointer value might not be all-bits-zero on some machines (or even just for some types on some machines).
Check out the Null Pointers section of the C FAQ for lots and lots of information.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…