hamburger

Specify the 2 library functions to dynamically allocate memory?

By BYJU'S Exam Prep

Updated on: September 25th, 2023

Specify the 2 library functions to dynamically allocate memory?

  1. malloc() and memalloc()
  2. alloc() and memalloc()
  3. malloc() and calloc()
  4. memalloc() and faralloc()

Answer- C. malloc() and calloc()

The library functions to allocate memory is malloc() and calloc() methods.

Solution

The answer to the question: Specify the 2 library functions to dynamically allocate memory is option C which is malloc() and calloc(). The malloc or memory allocation method is used to allocate memory dynamically. It returns a void pointer and takes only one input which is in bytes. While calloc() or contiguous allocation method dynamically allocates the specified number of chunks of memory of a specified type. It works similar to malloc(), it initializes each block with 0(zero).

☛ Related Questions:

The section with the maximum shape factor is the___.

A pointer is?

Which is not a valid constructor of thread class

Our Apps Playstore
POPULAR EXAMS
SSC and Bank
Other Exams
GradeStack Learning Pvt. Ltd.Windsor IT Park, Tower - A, 2nd Floor, Sector 125, Noida, Uttar Pradesh 201303 help@byjusexamprep.com
Home Practice Test Series Premium