What is the output?
#include <stdio.h>
void main(){
int **ptr;
int temp = 65;
ptr[0] = &temp;
printf("%d", ptr[0][0]);
}ptr is uninitialized, so it does not point to valid memory.
When the code tries to access ptr[0], it attempts to dereference an invalid location.
This leads to undefined behavior, and in most cases results in a segmentation fault.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.