Program given below will allocate the memory of ___ bytes for pointer "ptr".
#include<stdio.h>
#include<stdlib.h>
int main()
{
int *ptr;
ptr = (int*)malloc(sizeof(int)*4);
ptr = realloc(ptr,sizeof(int)*2);
return 0;
}
a) 2
b) 4
c) 8
d) none of the mentioned
Submitted by: Murtazac) 8
Explanation:
We can also use the realloc() to make memory block smaller.
Submitted by: Murtaza
Explanation:
We can also use the realloc() to make memory block smaller.
Submitted by: Murtaza
Read Online Linux Startup and Shutdown Job Interview Questions And Answers
Top Linux Startup and Shutdown Questions
☺ | At the end of kernel bootstrap, which process is started? |
☺ | Single user mode shell runs as: |
☺ | Which is the only partition mounted in Single user mode? |
☺ | Which of the following is not a valid run-level? |
☺ | The shell used for Single user mode shell is: |
Top Linux OS Categories
☺ | Device Drivers Interview Questions. |
☺ | Linux OS Management Interview Questions. |
☺ | Linux Makefile Interview Questions. |
☺ | Linux Environment Interview Questions. |
☺ | Linux OS Shell Interview Questions. |