1 votes 1 votes Assuming that a pointer take 4 bytes and the size of an integer is 2 bytes. What is the size of the *a in declaration: int (*a) [10][2] ? 4 80 20 40 sim1234 asked Dec 26, 2018 sim1234 707 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Magma commented Dec 26, 2018 reply Follow Share a ) 1 votes 1 votes kman30 commented Dec 26, 2018 reply Follow Share what is the answer ? 0 votes 0 votes Please log in or register to add a comment.
Best answer 1 votes 1 votes int (*a) [10][2] = a is pointer to array of [10]*[2] integers then 'a' will save address of array which is 4B sizeof(a)= 4B sizeof(*a)=10*2*2B=40 B Dharmendra Lodhi answered Dec 26, 2018 • selected Dec 26, 2018 by sim1234 Dharmendra Lodhi comment Share Follow See all 7 Comments See all 7 7 Comments reply sim1234 commented Dec 26, 2018 reply Follow Share but answer is given as 40 in the solution of grade up 0 votes 0 votes Shubhgupta commented Dec 26, 2018 i edited by Shubhgupta Dec 26, 2018 reply Follow Share shouldn't size of (*a) will be 10*2*size of int = 10*2*2= 40? @Mk Utkarsh please check? https://gateoverflow.in/196450/programming 0 votes 0 votes Mk Utkarsh commented Dec 26, 2018 reply Follow Share sorry my mistake. yes sizeof(*a) is asked and not sizeof(a) 0 votes 0 votes srestha commented Dec 26, 2018 reply Follow Share Ans will be 80 10*2*4 rt? 0 votes 0 votes Dharmendra Lodhi commented Dec 26, 2018 reply Follow Share @srestha size of integer is given 2B so we have to multiply by 2 0 votes 0 votes srestha commented Dec 26, 2018 reply Follow Share @Dharmendra Lodhi but *a is integer pointer So, why we take jus int value? 0 votes 0 votes srestha commented Dec 26, 2018 reply Follow Share @Mk Utkarsh will it not be 80? 0 votes 0 votes Please log in or register to add a comment.