317 views
0 votes
0 votes
#include<stdio.h>
int main()
{
    int a[2][2][2]={10,2,3,4,5,6,7,8};
    int *p,*q;
    p=&a[1][1][1];
    q=(int*)a;  //Please explain this line
    printf("%d%d"*p,*q);
    return 0;
}

Why we are doing typecasting here and what will be returned after type cast to q?

Please log in or register to answer this question.

Related questions

2 votes
2 votes
1 answer
3
0 votes
0 votes
1 answer
4
Psnjit asked Jan 12, 2019
1,162 views
main(){unsigned int i= 255;char *p= &i;int j= *p;printf("%d\n", j);unsigned int k= *p;printf("%d", k);} Both the outputs are -1. I have even tried with - int i = 255(3rd ...