Dynamic Memory Allocation :: sizeof()
- We have already seen this function in the array section. To recap,
sizeof()returns asize_tof the item passed in. So on a typical 32-bit machine,sizeof(int)returns 4 bytes.size_tis just an unsigned integer constant. sizeof()is helpful when usingmallocorcalloccalls. Note that sizeof() does not always return what you may expect (see below).