Question PRG-C-0008
EasyWhich function allocates memory dynamically in C?
- A.
malloc()
- B.
create()
- C.
Show answer and explanation
Answer: A
malloc() returns a pointer to uninitialised heap memory, which must later be released with free().
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
C question
Which function allocates memory dynamically in C?
malloc()
create()
Answer: A
malloc() returns a pointer to uninitialised heap memory, which must later be released with free().
new
alloc()