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 (253 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 (667 points)

Related questions

+3 votes
1 answer
6
asked Jan 6 in Programming by Lakshman Patel RJIT Boss (19.5k points) | 102 views
+1 vote
0 answers
7


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

44,240 questions
49,722 answers
163,928 comments
65,837 users