GeeksforGeeks » Interview Questions
Interview Question for Software Engineer/Developer (Fresher) about CPuzzles
(2 posts)-
#include<stdio.h> int main(void) { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *q = ***a; printf("%d", *q); getchar(); return 0; }output?
-
This code would give segmentation fault. The correct syntax should be :
#include<stdio.h>
int main(void)
{
int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} };
int *q = a;
printf("%d", *q);
getchar();
return 0;
}which will return 10.
Reply
You must log in to post.