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 ago in Programming by (153 points) | 16 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 ago by (85 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

36,991 questions
44,559 answers
43,622 users