What is the difference between malloc and calloc in terms of initialization of the allocated memory?
- Calloc initializes memory to an undetermined value.
- Calloc initializes memory to zero.
- Malloc initializes memory to an undetermined value.
- Malloc initializes memory to zero.
Malloc initializes memory to an undetermined value, while calloc initializes memory to zero. This difference is important when you want to ensure that allocated memory is initialized in a specific way.
Loading...
Related Quiz
- The strlen function returns the length of a string, excluding the ________.
- The function ________ is used to write data to a binary file.
- What is the role of pointers in relation to structures in C?
- An enumeration is a user-defined data type that consists of integral ________.
- When a floating-point number is declared using the ________ keyword, it allows for more precision than a regular float.