What is the output of this program?
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
int ptr;
ptr = (int)malloc(sizeof(int)*10);
return 0;
}
a) syntax error
b) segmentaion fault
c) run time error
d) none of the mentioned
Submitted by: Murtazad) none of the mentioned
Explanation:
The memory has been allocated but we can not access rest of the memory other than 4 bytes.
Output:
[root@localhost google]# gcc -o san san.c
[root@localhost google]# ./san
[root@localhost google]#
Submitted by: Murtaza
Explanation:
The memory has been allocated but we can not access rest of the memory other than 4 bytes.
Output:
[root@localhost google]# gcc -o san san.c
[root@localhost google]# ./san
[root@localhost google]#
Submitted by: Murtaza
Read Online Device Drivers Job Interview Questions And Answers
Top Device Drivers Questions
☺ | The major number identifies the _____ associated with the device. |
☺ | The kernel identifies the driver with its: |
☺ | The connection between the device file and device driver is based on the: |
☺ | In linux kernel 2.4, we can have: |
☺ | Which one of the following is not true? |
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. |