In which condition this prgram will print the string "google"?
#include<stdio.h>
#include<stdlib.h>
int main()
{
int *ptr;
ptr = (int *)malloc(sizeof(int)*10);
if (ptr == NULL)
printf("googlen");
return 0;
}
a) if the memory could not be allocated to the pointer "ptr"
b) if the memory has been allocated to the pointer "ptr" successfully
c) it will never print
d) none of the mentioned
Submitted by: Murtazaa) if the memory could not be allocated to the pointer "ptr"
Explanation:
The malloc() returns NULL when the memory is not allocated.
Submitted by: Murtaza
Explanation:
The malloc() returns NULL when the memory is not allocated.
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. |