Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
CPP 2
« Previous
Which of the following functions can be used to allocate space for array in memory?
Options
- calloc()
- malloc()
- realloc()
- both a and b
CORRECT ANSWER : calloc()
Discussion Board
C++ - Memory Allocation
Calloc allocates space for an array elements, initializes to zero and then returns a pointer to memory.
Prajakta Pandit 01-25-2017 02:28 AM
program
i want more programs no theory quiz
sathyapriya 08-19-2015 02:44 AM
answer is wrong
I agree with qwerty. However, for initial allocation of memory, only malloc() and calloc() can be used.
progManTic 02-17-2015 05:44 PM
Explanation
malloc() - Allocates requested size of bytes and returns a pointer first byte of allocated space
calloc() - Allocates space for an array elements, initializes to zero and then returns a pointer to memory
realloc() - Change the size of previously allocated space
career 08-13-2014 12:37 AM
calloc, malloc, realloc
you are mistaken: all three of those functions can be used for allocating space for array in memory
qwerty 08-12-2014 05:29 AM
« Previous
Write your comments
*
*
Email must be in the form someone@domain.com
*
*
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
C test (42)
C (12)
C++ for beginners (10)
C++ (20)
C++ (24)
C++ (18)
C++ (14)
C++ (12)
C++ (15)
C++ (15)
Data structure (20)
Data structure (10)
Data structure (10)
Data structure (10)
PERL (25)
VC++ (11)
Oops (30)
Mainframe (41)
Mainframe (15)
Embedded systems (15)
OOAD (49)
Advertisement
▲