#include<stdio.h>

main()

{

int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} };

int *p,*q;

p=&a[2][2][2];

*q=***a;

printf("%d----%d",*p,*q);

}



#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; ..

Answer / susie

Answer :

SomeGarbageValue---1

Explanation:

p=&a[2][2][2] you declare only two 2D arrays,
but you are trying to access the third 2D(which you are not
declared) it will print garbage values. *q=***a starting
address of a is assigned integer pointer. Now q is pointing
to starting address of a. If you print *q, it will print
first element of 3D array.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Code Interview Questions

What is "far" and "near" pointers in "c"...?

3 Answers  


how to concatenate the two strings

1 Answers  


main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }

2 Answers  


main() { int i = 3; for (;i++=0;) printf(“%d”,i); }

1 Answers   CSC,


main( ) { int a[ ] = {10,20,30,40,50},j,*p; for(j=0; j<5; j++) { printf(“%d” ,*a); a++; } p = a; for(j=0; j<5; j++) { printf(“%d ” ,*p); p++; } }

1 Answers  






Derive expression for converting RGB color parameters to HSV values

1 Answers  


Write a routine that prints out a 2-D array in spiral order

3 Answers   Microsoft,


respected sir, i did my MCA in 2013 when i am going to attend to an interview i was asked about my project how will i explain my project could please help me in this and my project title is "Social Networking Site For Social Responsibility"

1 Answers   Genpact, Ozdocs,


Is the following code legal? struct a { int x; struct a b; }

1 Answers  


main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } a. 2 b. 100 c. 4 d. none of the above

5 Answers   HCL,


how many processes will gate created execution of -------- fork(); fork(); fork(); -------- Please Explain... Thanks in advance..!

8 Answers   GATE,


Write a single line c expression to delete a,b,c from aabbcc

2 Answers   Microsoft,


Categories