sizeof void pointer

前端 未结 5 637
无人及你
无人及你 2020-12-24 07:24

why is sizeof void pointer 2 ?

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-24 08:01

    The size of a void* is a platform dependent value. Typically it's value is 4 or 8 bytes for 32 and 64 bit platforms respectively. If you are getting 2 as the value then your likely running on a 16 bit coding platform (or potentially have a coding error).

    Could you post the code you are using and some more information about your environment / operating system?

提交回复
热议问题