Dynamic Memory Allocation :: sizeof()

Dynamic Memory Allocation :: sizeof()

  • We have already seen this function in the array section. To recap, sizeof() returns a size_t of the item passed in. So on a typical 32-bit machine, sizeof(int) returns 4 bytes. size_t is just an unsigned integer constant.
  • sizeof() is helpful when using malloc or calloc calls. Note that sizeof() does not always return what you may expect (see below).

Post a Comment

Please Select Embedded Mode To Show The Comment System.*

Previous Post Next Post