[Solved] sizeof dynamic array is not correct [duplicate]
You don’t have an array; you have a pointer. The size of the pointer is measured in bytes, not bits. sizeof is evaluated at compile time and is constant for any given expression or type. It does not depend on the number of “filled” elements in an array (or pointer to some space that holds … Read more