Question: In the following code, the first printf) reached produces the output 14, but the second printf) can cause a bus error or a segmentation fault.

 In the following code, the first printf) reached produces the output

In the following code, the first printf) reached produces the output "14," but the second printf) can cause a bus error or a segmentation fault. Why? 4. main() int *p; funct(p); printf ( "%d " , *p) ; funct(int *p2) p2 (int *)malloc(4); *p2-14; printf ( "%d ", *p2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!