The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
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?
asked in Programming by (271 points) | 31 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 (667 points)

Related questions

+1 vote
0 answers
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
48,435 questions
52,746 answers
68,219 users