How does sizeof know the size of the operand array?

前端 未结 12 1223
臣服心动
臣服心动 2020-12-03 13:16

This may be a stupid question but how does the sizeof operator know the size of an array operand when you don\'t pass in the amount of elements in the array. I know it does

12条回答
  •  渐次进展
    2020-12-03 13:47

    The compiler knows the size of each type in your application, and sizeof just requests the compiler to produce that value for you.

提交回复
热议问题