Question
a.
int *p;
p = (int*)malloc(10*sizeof(int));
b.
int *p;
p = (int*)malloc(10,sizeof(int));
c.
int *p;
p = (int*)malloc(sizeof(int), 10);
d.
int *p;
p = (int*)malloc(10*sizeof(int *));
Posted under C Programming
p = (int*)malloc(10*sizeof(int));
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. Choose a correct Syntax for malloc() function to allocate memory to an array at run time.
Similar Questions
Discover Related MCQs
Q. What is the function used to allocate memory to an array at run time without initializing array elements?
View solution
Q. What is the function used to allocate memory to an array at run time with Zero initial value to each?
View solution
Q. If an integer array pointeris incremented, how many bytes will be skipped to reach next element location?
View solution
Q. What is a multidimensional array in C Language?
View solution
Q. What is the need for C arrays?
View solution
Q. Can we change the starting index of an array from 0 to 1 in any way?
View solution
Q. What happens when you try to access an Array variable outside its Size?
View solution
Q. What is the value of an array element which is not initialized?
View solution
Q. An entire array is always passed by ___ to a called function.
View solution
Q. What is an array Base Address in C language?
View solution
Q. An array Index starts with
View solution
Q. What are the Types of Arrays?
View solution
Q. Choose a correct statement about C language arrays.
View solution
Q. What is an Array in C language?
View solution
Q. Is the NULL pointer same as an uninitialised pointer?
View solution
Q. Are the three declarations char **apple, char *apple[], and char apple[][] same?
View solution
Q. Choose the best one.
Prior to using a pointer variable
View solution
Q. Comment on this:
const int *ptr;
View solution
Q. What is wild pointer?
View solution
Q. How can you write a[i][j][k][l] in equivalent pointer expression?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond C Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!