in Programming in C
253 views
0 votes
0 votes
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?
in Programming in C
253 views

1 Answer

0 votes
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.

Related questions