array
is a pointer in your code. sizeof(array)
therefore returns the size of that pointer in C bytes (reminder: C's bytes can have more than 8 bits in them).
So, 8 is your pointer size.
Also, the correct type specifier for size_t
in printf()'s format strings is %zu
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…