Microsoft

  www.microsoft.com
Work in HR? Unlock Free Profile

Microsoft Software Developer Engineer Intern Interview Question (student candidate)

I interviewed in Bellevue, WA and was asked:
"What is the difference between malloc and calloc."
Add Tags [?]
Answer

Part of a Software Developer Engineer Intern Interview Review - one of 3,354 Microsoft Interview Reviews

Answers & Comments

0
of 0
votes
malloc allocates a block of uninitialized memory and returns a pointer to that block of memory. Its signature is along the lines of void* malloc( unsigned long size ).

calloc allocates a block of cleared memory and returns a pointer to that block of memory. Its signature is along the lines of void* calloc( unsigned long size, unsized long count ).
- Tim on Feb 28, 2012

To comment on this question, Sign In with Facebook or Sign Up

Tags are like keywords that help categorize interview questions that have something in common.