The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
28 views
If we take a 1-D array b[10] b is the pointer to 1st element of array because b has the address of 1st element of array...but sizeof(b) will give the size of whole array rather than just giving the size of single pointer b ...can anyone explain the reason for that?
asked in Programming by (201 points) | 28 views

1 Answer

0 votes
b is the array name which hold the address of array.Address of array as well as address of array's first element will be same because both's starting address is same. Now b is array name so sizeof (b) gives whole array size where if u will try sizeof (b [0]) it gives size of array element data type.
answered by Junior (729 points)


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

39,751 questions
46,767 answers
140,658 comments
58,530 users